a = int(input())
b = int(input())
c = int(input())
d = 0
if a < 60:
d += 1
if b < 60:
if c < 60: d += 1
if d == 1: print(d)