def leap_year(year): if (year % 4) == 0: if (year % 100) == 0: if (year % 400) == 0: return 1 else: return 0 else: return 1 else: return 0 while True: try: date_list=input().split() count_days=0 dic_leap={1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} dic_nonleap={1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} if leap_year(int(date_list[0]))==1: for i in range(1,int(date_list[1])): count_days+=dic_leap.get(i) count_days+=int(date_list[2]) else: for i in range(1,int(date_list[1])): count_days+=dic_nonleap.get(i) count_days+=int(date_list[2]) print(count_days) except: break