s = input().split() s = list(map(int, s)) cout = 0 for year in s: if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): cout += 1 print(cout)