def fyi(number):
    if number[:3] == '555':
        print(1)
    else:
        print(0)


number = fyi(str(input()))

fe07ee66140ad726f0d0074a9d0fbdf1448037f7
<mask token>

def fyi(number):
    if number[:3] == '555':
        print(1)
    else:
        print(0)


<mask token>

def fyi(number):
    if number[:3] == '555':
        print(1)
    else:
        print(0)


number = fyi(str(input()))
