A teacher gave candies to her class. To each girl, she gave a number of candies equal to the total number of girls. To each boy, she gave a number of candies equal to the total number of boys. She distributed exactly 365 candies in all. The number of girls is exactly one more than the number of boys. How many girls are in the class?