'''TESTCASE
80
-
120
-
400
'''
n = int(input())

cnt = 0
for i in range(1, n+1):
    x = i
    s = 0
    while x:
        s += x % 10
        x //= 10
    if s % 5 == 0:
        cnt += 1

print(cnt)
dcb6fcdb14aa5e66a446e7e68f0b052af81a66f0
<mask token>

<mask token>
for i in range(1, n + 1):
    x = i
    s = 0
    while x:
        s += x % 10
        x //= 10
    if s % 5 == 0:
        cnt += 1
print(cnt)

<mask token>
n = int(input())
cnt = 0
for i in range(1, n + 1):
    x = i
    s = 0
    while x:
        s += x % 10
        x //= 10
    if s % 5 == 0:
        cnt += 1
print(cnt)

'''TESTCASE
80
-
120
-
400
'''
n = int(input())

cnt = 0
for i in range(1, n+1):
    x = i
    s = 0
    while x:
        s += x % 10
        x //= 10
    if s % 5 == 0:
        cnt += 1

print(cnt)