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