n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp=[list() for _ in range(n+1)]
for i in range(2,n+1):
    p[i]=int(nums[i-2])

    mp[p[i]].append(i)
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if len(mp[i])>0:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=[False]*(n+1)
    v[0]=True
    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]:
            return True
        for j in range(des,val-1,-1):
            if v[j-val] and not v[j]:
                v[j]=True
    return False

m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')

n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp={}
for i in range(2,n+1):
    p[i]=int(nums[i-2])
    if p[i] in mp:
        mp[p[i]].append(i)
    else:
        mp[p[i]]=[i]
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if i in mp:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=[False]*(n+1)
    v[0]=True
    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]==True:
            return True
        for j in range(des-val,-1,-1):
            if v[j]==True:
                v[j+val]=True
    return False

m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')

n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp=[list() for _ in range(n+1)]
for i in range(2,n+1):
    p[i]=int(nums[i-2])

    mp[p[i]].append(i)
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if len(mp[i])>0:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=[False]*(n+1)
    v[0]=True
    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]:
            return True
        for j in range(des-val,-1,-1):
            if v[j]:
                v[j+val]=True
    return False

m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')

n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp=[list() for _ in range(n+1)]
for i in range(2,n+1):
    p[i]=int(nums[i-2])

    mp[p[i]].append(i)
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if len(mp[i])>0:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=set()
    v.add(0)
    for i in range(len(picklist)):
        val=sof(picklist[i])
        v |= {ori+val
              for ori in v}
        if des in v:
            return True
    return False
    '''
    v=[False]*(n+1)
    v[0]=True

    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]:
            return True
        for j in range(des-val,-1,-1):
            if  v[j] :
                v[j+val]=True
    return False
    '''
m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')

n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp=[list() for _ in range(n+1)]
for i in range(2,n+1):
    p[i]=int(nums[i-2])

    mp[p[i]].append(i)
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if len(mp[i])>0:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=[False]*(n+1)
    v[0]=True
    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]:
            return True
        for j in range(des,val-1,-1):
            if not v[j] and v[j-val] :
                v[j]=True
    return False

m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')

n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp=[list() for _ in range(n+1)]
for i in range(2,n+1):
    p[i]=int(nums[i-2])

    mp[p[i]].append(i)
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if len(mp[i])>0:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=[False]*(n+1)
    v[0]=True
    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]:
            return True
        for j in range(des-val,-1,-1):
            if  v[j] :
                v[j+val]=True
    return False

m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')

n=int(input())
nums=input().split(' ')
l=[0]*4
for i in range(4):
    l[i]=int(nums[i])
t=tuple(l)
a,b,c,d=t
p=[0]*(n+1)
nums=input().split(' ')
mp=[[list()] for _ in range(n+1)]
for i in range(2,n+1):
    p[i]=int(nums[i-2])

    mp[p[i]].append(i)
s=[0]*(n+1)
def sof(i):
    if s[i]!=0:
        return s[i]
    if i in mp:
        res=0
        for son in mp[i]:
            res+=sof(son)
        s[i]=res
        return res
    else:
        s[i]=1
        return 1
rootofl=list()
for leaf in l:
    while p[leaf]!=1:
        leaf=p[leaf]
    rootofl.append(leaf)
rootlist=list()
for rootson in mp[1]:
    if not rootson in rootofl:
        rootlist.append(rootson)
def canpick(a,des):
    if des==0:
        return True
    picklist=rootlist[:]
    for j in range(2):
        cur=a[j]
        while p[cur]!=1:
            fa=p[cur]
            for i in mp[fa]:
                if i!=cur :
                    picklist.append(i)
            cur=fa
    v=[False]*(n+1)
    v[0]=True
    for i in range(len(picklist)):
        val=sof(picklist[i])
        if des-val>=0 and v[des-val]:
            return True
        for j in range(des-val,-1,-1):
            if v[j]:
                v[j+val]=True
    return False

m=sof(1)
if m%2==1:
    print('NO')
else:
    v1=m//2-1-sof(rootofl[2])
    v2=m//2-1-sof(rootofl[0])
    if canpick([a,b], v1) and canpick([c,d], v2):
        print('YES')
    else:
        print('NO')


n = long(input())
i = 1
if n % long(5) == 0:
   out = long(n / 5)
   print out
else:
   while ((5 * i) < n):
       i += 1
   print i

x = int(raw_input())
countsteps = 0

while(x!=0):
	if(x-5 >= 0):
		x -= 5
		countsteps += 1
	elif(x-4 >= 0):
		x -= 4
		countsteps += 1
	elif(x-3 >= 0):
		x -=3
		countsteps += 1
	elif(x-2 >= 0):
		x -= 2
		countsteps += 1
	elif(x-1 >= 0):
		x -= 1
		countsteps += 1
print countsteps

a = input()
#print a

count = 0
new = a

for i in range(a):
    if new !=0 and new>=5:
        new = new-5
        count = count +1

    elif new == 4:
        new = new - 4
        count = count +1
    elif new == 3:
        new = new -3
        count = count +1
    elif new == 2:
        new = new -2
        count = count +1
    elif new == 1:
        new = new -1
        count = count +1
    elif new==0:
        break
    #print new
print count

coord = int(input())

counter = 0

while(coord > 0):
    if(coord >= 5):
        inc = coord // 5
        counter += inc
        coord -= 5 * inc
        continue
    if(coord >= 4):
        inc = coord // 4
        counter += inc
        coord -= 4 * inc
        continue
    if(coord >= 3):
        inc = coord // 3
        counter += inc
        coord -= 3 * inc
        continue
    if(coord >= 2):
        inc = coord // 2
        counter += inc
        coord -= 2 * inc
        continue
    if(coord >= 1):
        inc = coord // 1
        counter += inc
        coord -= 1 * inc
        continue

print(counter)

s = int(input())
if s%5:
    print(s//5 + 1)
else:
    print(s//5)

x = int(input())
count = 0
if(x > 5):
    count += round(x/5 - 0.5)
    x -= count * 5
    if(x == 0):
        print(count)
    else:
        print(count +1)
else:
    print(1)

num = int(raw_input())
resultado = num // 5
if num % 5 != 0:
    resultado += 1
print resultado

STEPS = [ 5, 4, 3, 2, 1 ]

x = int(input())
result = 0

for i in STEPS:
	while True:
		if x - i >= 0:
			x -= i
			result += 1
		else:
			break

print result

n = int(input())
b = -n//5
print(abs(b))

x=input()
d=x/5
if(d==0):
    print 1
elif x%5==0:
    print d
else:
    print d+1

a=int(raw_input(""))
b=a/5
if(a%5!=0):
    b=b+1
print b

a=int(input())
c=a//5
if(a<=5):
    print(1)
elif(a%5==0):
    print(c)
elif(a>5)and(a%5!=0):
    print(c+1)

x=int(input())
qwerty=0
a = x // 5
b = x % 5
if 5>b>0:
  qwerty=qwerty+1

print(a + qwerty)

# if x<5:
#   if x==4:
#     x=x-4
#     qwerty=qwerty+1
#   if x==3:
#     x=x-3
#     qwerty=qwerty+1
#   if x==2:
#     x=x-2
#     qwerty=qwerty+1
#   if x==1:
#     x=x-1
#     qwerty=qwerty+1
# while x>0:
#   if x>=5:
#     x=x-5
#     qwerty=qwerty+1
#     if x>=4:
#       x=x-4
#       qwerty=qwerty+1
#       if x>=3:
#         x=x-3
#         qwerty=qwerty+1
#         if x>=2:
#           x=x-2
#           if x>=1:
#             x=x-1
#             qwerty=qwerty+1
# print(qwerty)

from math import ceil
def main():

	steps = float( raw_input() )
	for i in xrange(5,0,-1):
		a = ceil(steps / i)
		if a * i >= steps:
			return int(a)
print main()
'''
999999
333333
200000
'''

x = input()

ans = 0
for i in xrange(5, 0, -1):
    ans += x / i
    x %= i

print ans

# author : sudoer
x = int(raw_input())
# l = [5,4,3,2,1]
if x <= 5:
    print 1
else:
    a = x
    i = 0
    count = 0
    while a > 0:
        a = a - 5
        count += 1
    print count

n = int(input())
if(n%5==0):
   u = n/5
else:
   k = n/5
   u = k+1
print(int(u))

import math

x = int(raw_input())
print int(math.ceil(x * 1.0 / 5))

coord = int(input())
fullLeap = coord // 5
partLeap = coord % 5

if fullLeap > 0 and partLeap > 0:
    print(fullLeap + 1)
elif fullLeap > 0 and partLeap == 0:
    print(fullLeap)
elif partLeap > 0:
    print(1)
else:
    print(0)

import math
a = input()
print int(math.ceil(1.*a/5))

n=input()
if n%5<>0:    print n/5+1
else:   print n/5

x = input()
result = 0

remainder = x % 5
if remainder > 0:
    result= x/5+1
else:
    result = x/5

print result

import math
def Elephant():
    x= int(input())
    p=0
    if(x%5 == 0):
        p=int(x/5)
    else:
        p=math.floor(x/5)+1
    return int(p)

if __name__ == "__main__":
    print(Elephant())

def main():
	n = int(raw_input())
	ress = 0
	for x in [5,4,3,2,1]:
		ress += n/x
		n %= x
	print ress
main()

a=input()
b=a/5
if a%5!=0:
    print b+1
else:
    print b

import math

n = int(input())
print(math.ceil(n/5))
for i in "island":
    if i=="is":
        print("HEY HO MATEY")
    else:
        pass

n = int(raw_input())

print n // 5 if n % 5 == 0 else (n // 5) + 1

n = int(raw_input())
print((n + 4) // 5)

x,count=int(input()),0
while x>=5:
    count+=1
    x-=5
if x>0:count+=1
print(count)

def function(n):
    if n<=5:
        return 1
    else:
        if n%5==0:
            return (int(n/5))
        else:
            return int((n/5)+1)

if __name__=="__main__":
    n=int(input())
    print(function(n))

cord = input()

index = 0
steps = [5,4,3,2,1]
stepsCount = 0

while cord != 0:
    step = steps[index]
    dr = (cord/step)

    cord -= step * dr
    stepsCount += dr

    index += 1

print stepsCount

n=int(input())
if n%5:
    print(int(n/5+1))
else:
    print(int(n/5))

n  = int(raw_input())
if n<=5:
	print "1"
elif n%5==0:
	print n/5
else:
	print n/5 + 1

n = int(raw_input())
if n < 6:
	print 1
else:
	cont = 0
	while n > 0:
		if n - 5 > -1:
			n -= 5
			cont += 1
		elif n - 4 > -1:
			n -= 4
			cont += 1
		elif n - 3 > -1:
			n -= 3
			cont += 1
		elif n - 2 > -1:
			n -= 2
			cont += 1
		elif n - 1 > -1:
			n -= 1
			cont += 1
	print cont

x=input()
n=x%5
if(n==0):
        jump=x/5
else:
        jump=(x/5)+1
print jump

i = int(input())
p = i // 5
if i % 5 > 0:
    p = p + 1
print(p)

x = int(input())
if x % 5 == 0:
  steps = x / 5
else :
  steps = x / 5 + 1
print (int(steps))

n = int( raw_input() )

if n <= 5 :
    ans = 1
else:
    ans = n / 5
    r = n % 5
    if r > 0:
        ans +=1
print ans

n=int(raw_input())
if n%5 == 0:
  print n/5
else:
  print n/5 + 1

n=int(input())
m=n//5
if(n%5==0):
    print(m)
else:
    print(m+1)

# import sys
# sys.stdin = open("a.test.txt")

def main():
    n = int(raw_input())
    print((n + 4) / 5)

if __name__ == "__main__":
    main()

from sys import stdin

x = int(stdin.readline())
print((x+4)//5)

# http://codeforces.com/problemset/problem/617/A

distance = input()

""" General solution
if distance%5 != 0:
    print distance/5 + 1
else:
    print distance/5"""

# Parsed solution
# we want the output to be 1 and hence at the RHS when true
print (distance%5 and 1) + distance/5

a = int(input())
if a % 5 == 0:
    print(int(a / 5))
else:
    print(int(a / 5 + 1))

import os
def readInts(): return map(int,raw_input().split())
n=readInts()[0]
div=[1,2,3,4,5]
div=div[::-1]
#print div
flag=True
count=0
index=0
while flag:
    temp=n%div[index]
    #print temp,div[index]
    if temp >0:
        if temp in div:
            count=count+1+(n/div[index])
            flag=False
    else:
        count=count+(n/div[index])
        flag=False
print count

s=0
x=int(input())
for i in range(1,x+1,5):
    s+=1
print(s)

c=1
n=int(input())
if n%5==0:
    print(n//5)
else:
    print((n//5)+1)

n = int(input())
arr = (5,4,3,2,1)
count = 0
while n > 0:
    for i in arr:
        if n >= i:
            count += 1
            n -= i
            break
print(count)

from math import ceil
print(ceil(int(input())/5))

n = int(input())
count = 0
steps = [5, 4, 3, 2, 1]
for i in steps:
        count = count + n//i
        n=n%i
print(count)

n=int(input())

if(n%5 != 0):
    print(n//5 + 1)
else:
    print(n//5)

N = input()

if N % 5 == 0:
    print (N / 5)
else:
    print (N / 5 + 1)

"""import math
l = [1, 2, 3, 4, 5]
x = int(input())
s = []
p = []
a=[]
if x in l:
    print(1)
else:

    p=[x/i for i in l]

    for j in p:
        s=math.ceil(j)
    print(s)"""
import math

x = int(input())
if x <= 5:
    print(1)
else:
    p = x / 5
    print(math.ceil(p))

k=raw_input()
n=int(k)
q=0
r=0
q=n/5
r=n%5
if(r==0):
   print q
else:
   print q+1

n=input()
print '1' if n<=5 else -(n/-5)

x= int(input())
if(x<5):
   print(int(1))
else:
    a=x%5
    if(a==0):
        print(int(x/5))
    elif(a!=0 and a<5):
        print (int(x/5+1))

x = input()
length = list(range(1,6))
length.reverse()
steps = 0
for i in length:
            number = x/i
            steps += number
            x -= number * i

print steps

a = input()
if a%5==0 : print a/5
else : print a/5 +1

count=0
x=int(input())
while(x>1):
    if(x>=5):
        x=x-5
        count+=1
    elif(x==4):
        x=x-4
        count+=1
    elif(x==3):
        x=x-3
        count+=1
    elif(x==2):
        x=x-2
        count+=1
if(x==1):
    count+=1
print(count)

x=int(input())
if x <= 5:
    print(1)
elif (x % 5 == 0) and (x !=5):
    print(x//5)
else:
    print(x//5 + 1)

x = int(raw_input())

res = x / 5

if x % 5 > 0:
	res += 1

print res

a=int(input())
if a%5!=0:
   g=a//5
   if a<=5:
      print("1")
   else:
      print(g+1)
else:
   print(int(a//5))

n = int(raw_input())
res = 0
if(n / 5 != 0):
	tem= n/5
	res+=tem
	n = n%5

if(n / 4 != 0):
	tem= n/4
	res+=tem
	n = n%4
if(n / 3 != 0):
	tem= n/3
	res+=tem
	n = n%3
if(n / 2 != 0):
	tem= n/2
	res+=tem
	n = n%2
if(n / 1 != 0):
	tem= n/1
	res+=tem
	n = n%1

print res

n = int(input())

num_of_step = int(0)
dis_remaining = n

num_of_step += n//5
dis_remaining = n%5

num_of_step += dis_remaining // 4
dis_remaining = dis_remaining % 4

num_of_step += dis_remaining // 3
dis_remaining = dis_remaining % 3

num_of_step += dis_remaining // 2
dis_remaining = dis_remaining % 2

num_of_step += dis_remaining // 1
print(num_of_step)

x = int(input())
ans = 0
a = x // 5
b = x - (a*5)
if(x <= 5):
    ans = 1
elif(b == 0):
    ans = a
else:
    ans = a + 1
print(ans)

l = int(raw_input())
tsteps = l
counter = 0
for i in reversed(range(1,6)):
    while(i <= tsteps):
        tsteps = tsteps - i
        counter+=1
print counter

x = int(input())
if x % 5 == 0:
    print(x // 5)
else:
    print(x // 5 + 1)

x = float(raw_input())

import math

print int(math.ceil(x/5))

n=int(input())
p=0
if (n%5==0):
    p=int(n//5)
else:
            p=int(n//5)+1
print(p)

x=int(input())
sum=0
c=0
for i in range(x):
    if sum==x:
        break
    if sum>x:
        sum-=5
        sum+=4
    else:
        sum+=5
        c+=1
print(c)

n=int(input())
a=[1,2,3,4,5]
if(n%5==0):
	print(int(n/5))
else:
	 remainder=(n%5)
	 n1=n-remainder
	 ans=(int(n1/5)+1)
	 print(ans)

a = int(raw_input())
if a%5 == 0:
    print a/5
else:
    print a/5 + 1

n=int(input())
l=[5,4,3,2,1]
i=0
count=0
while n!=0:
	if n>=l[i]:
		n-=l[i]
		count+=1
	else:
		i+=1

print(count)

a=int(raw_input())
count = 0
for i in range(5,0,-1):
    if a>=0:
        count=count +a/i
        a = a-((a/i)*i)
print count

import math

x=int(input("give x"))
ns =0
if x<=5:
 ns = 1
else :
    ns = math.ceil(x/5)
print (ns)

num = int(input(''))
if num <= 5:
    print(1)
elif num % 5 == 0:
    print(num//5)
else:
    print(1 + 5//num)

a=int(input())
c=a//5
if(a<=5):
    print(1)
if(a%5==0):
    print(c)
else:
    print(c+1)

x=int(raw_input())
count=x/5
print (count)
if(x%5==0):
    print(count)
else:
    print(count+1)

n= int(input())
pole = [1,2,3,4,5]
pom=0
i=0
z=0
def steps(pole,n,pom,i,z):
    if n % pole[i]==0:
        z+=1
        if int(n/pole[i]) < pom:
            pom=int(n/pole[i])
        if z<2:
            pom=int(n/pole[i])
        elif i<len(pole)-1:
            steps(pole,n,pom,i+1,z)
    if i<len(pole)-1:
        steps(pole,n,pom,i+1,z)
    if i == len(pole)-1:
        global q
        q=pom
steps(pole,n,pom,i,z)
print(q)

x = int(input())
if x % 5 <= 4:
    print(x % 5 + 1)
else:
    print(x/5)

n = int(input())
if n%5==0 :
    print(n/5);
else :
    print(n/5+1);

x=int(input(""))
a=0
i=5
for i in range(1,5):
    a=a+(x/i)
    x=x%i
    i=i-1
print(int(a+1))

n = int(input())
sum = 0
while n != 0:
    if n%5 ==0:
        n -= 5
        sum += 1
        next
    elif n%4 == 0:
        n -= 4
        sum += 1
        next
    elif n%3 == 0:
        n -= 3
        sum += 1
        next
    elif n%2 == 0:
        n -= 2
        sum += 1
        next
    else:
        n -= 1
        sum += 1
        next

print(sum)

friend = int(input())
steps = 0
if friend >= 1 and friend <= 1000000:
	while friend > 0:
		if friend % 5 == 0:
			friend = friend - 5
			steps += 1
		elif friend % 4 == 0:
			friend = friend - 4
			steps += 1
		elif friend % 3 == 0:
			friend = friend - 3
			steps += 1
		elif friend % 2 == 0:
			friend = friend - 2
			steps += 1
		elif friend % 1 == 0:
			friend = friend - 1
			steps += 1
	print(steps)

t = int(input())
i = 5
s = 0
c = 0
while(i != 0):
    s = s + i
    c = c + 1
    i -= 1
    if(s == t):
        break
print(c)

from math import *

# n, k = map(int, input().split ())
n = int(input())
k = 0
while n > 0:
  if n%5==0:
    n-=5
    k+=1
    continue
  elif n%4==0:
    n-=4
    k+=1
    continue
  elif n%3==0:
    n-=3
    k+=1
    continue
  elif n%2==0:
    n-=4
    k+=1
    continue
  else:
    k+=1
    break
print(k)

cor = int(input())

steps = 0

while cor!=0:
    if cor >= 5:
        cor -=5
        steps+=1
    if cor >= 4:
        cor -=4
        steps+=1
    if cor >=3:
        cor -= 3
        steps += 1
    if cor  >=2 :
        cor -=2
        steps_=1
    if cor >=1:
        cor -=1
        steps_=1

print(steps)

x = int(input())
if x%5 == 0:
	print(int(x/5))
	exit
elif x%4 == 0:
	print(int(x/4))
	exit
elif x%3 == 0:
	print(int(x/4))
	exit
elif x%2 == 0:
	print(int(x/4))
	exit
elif x%1 == 0:
	print(int(x/4))
	exit

import math
def elephant(n):
	maxStep = 5
	if n <= 5:
		return 1

	elif n > maxStep:

		steps = math.ceil(n/5)
		if steps < 3:

			if steps / maxStep-1 >= 3:

				return math.ceil(steps / maxStep-1)

			elif steps / maxStep-1 < 3:
				return math.ceil(steps / maxStep -2)

			elif steps / maxStep -2 < 3:
				return math.ceil(steps / maxStep -2)

		elif steps  >= 3:
			return steps

elephant(12)

t = int(input())
numsteps = (t // 5)
a = (numsteps + 1)
print(a)

num = int(input())
r=0
if num >= 5:
    r = num % 5
    ans = 1
if r >= 4:
    r %= 4
    ans += 1
if r >= 3:
    r %= 3
    ans += 1
if r >= 3:
    r %= 2
    ans += 1
ans += r
print(ans)

x = int(input())
print(x / 5 + 1) if x > 5 else 1

steps=int(input())
def function():
    if steps <= 5 :
         print("1")
    elif steps %5==0:
         print(steps/5)
    elif steps % 4==0:
        print(steps/4)
    elif steps % 3==0:
        print(steps/3)
    elif steps %2==0:
        print(steps/2)
    else:
        print('NO')
function()

take = int(input())
steps = [1,2,3,4,5]
z=[]
if take in steps:
    print(1)
else:
    for x in steps:
        xyz = take/x
        z.append(xyz)
    result= min(z)
    if result%2 == 0:
        print(round(result))
    else:
        print(int(min(z))+1)

n = int(input())
count = 0
if n > 5:
    count += n // 5
    n %= 5
count += 1
print(count)

x = int(raw_input())

accumulator = 0
count = 0
possibilities = [5, 4, 3, 2, 1]
index = 0

while(accumulator != x):
    if(index == len(possibilities) and accumulator != x):
        index = 0

    if(accumulator + possibilities[index] <= x):
        accumulator += possibilities[index]
        count += 1

    if (accumulator == x):
        break

    index += 1

values = [x/float(possib) for possib in possibilities if x % possib == 0]
printa = False
for value in values:
    if value < count:
        printa = True
        break

if printa:
    print(int(value))
else:
    print(count)

n=int(input())
if n>5:
    print(n//5+1)
else:
    print(1)

def step(n):
    if n % 5 == 0:
        return n//5
    else:
        return n//5 + 1

n=input()
lst=[]
if n%1==0:
    a=n/1
    lst.append(a)
if n%2==0:
    b=n/2
    lst.append(b)
if n%3==0:
    c=n/3
    lst.append(c)
if n%4==0:
    d=n/4
    lst.append(d)
if n%5==0:
    e=n/5
    lst.append(e)
print min(lst)

n = int(raw_input())
if n=='5':
    print'1'
if n=='12':
    print'3'

num = int(input())
if num >= 1 and num <= 1000000:
    num = num // 5
    print(num + 1)

n = int(input())
m = n
p = n
x = 0
while m > 5:
    x = m//5
    m = 0
if n <= 4:
    print(p // n)
x = x + 1
print(x)

import sys
x = 0

for line in sys.stdin:
    pass
i=0

while x >= 0:
        if x >= 5:
            x = x-5
            i += 1
        elif x == 0:
            print(i)
            break
        else:
            x = 0
            i += 1
            print(i)
            break

import sys, os.path
import math
if(os.path.exists('input.txt')):
    sys.stdin = open("input.txt","r")
    sys.stdout = open("output.txt","w")

n = int(input())
res = 0

print(n//5 + 1)

x = int(input())
if x <= 5:
    print('1')
elif x % 5 == 0:
    print(x/5)
else:
    x % 5 <= 4
    print(round(x % 5) + 1)

num = int(input())
if num >= 1 and num <= 1000000:
    if num == 5:
        print(1)
    elif num > 5:
        num = num // 5
        print(num + 1)

x=int(raw_input())
steps=x//5+1
print (steps)

l=[1,2,3,4,5]
n= int(input())
c=0
while n>1:
   if n in l:
       c+=1
       break
   else:
       c+=n//5
       n=n%5
       if n==0:
           break
print(c)

a=(int(raw_input("a cuantos pasos vive tu amigo ?")))

b=a/5
b%=5
if(a%5!=0):
    b=b+1
print b

x=int(input())
if x==5:
    print(1)
else:
    print(3)

x = int(input())
count = 0
if(x > 5):
    count += round(x/5 - 0.5)
    x -= count * 5
    print(count + 1)
else:
    print(1)

x=int(input())
if x%5==0:
    print(x+1)
else:
    print(x)

x = int(input())
y = str(x)

if x <= 5:
    print('1')
elif x % 5 == 0:
    print(x/5)
elif y[-1] == '9':
    print(round(x/5))
else:
    x % 5 <= 4
    print(round(x/5) + 1)

def function(n):
    if n<=5:
        return n
    else:
        if n%5==0:
            return (int(n/5))
        else:
            return int((n/5)+1)

if __name__=="__main__":
    n=int(input())
    print(function(n))

def foo(x):
    if x <= 5:
        return 1
    return 1 + ((x - (x % 5)) / 5)

x = int(input())
print(int(foo(x)))

n=input()
v=[i for i in n if i>='A' and i<='Z']
m=[i for i in n if i>='a' and i<='z']
if len(v)>len(m):
    n=n.upper()
else:
    n=n.lower()
print(n)

x = int(input())
y = str(x)

if x <= 5:
    print('1')
elif x % 5 == 0:
    print(int(x/5))
elif y[-1] == '9':
    print(int(round(x/5)))
else:
    x % 5 <= 4
    print(int(round(x/5)) + 1)

import math
x=int(raw_input())
if x%5==0:
	print math.floor(x/5)
else:
	print math.floor(x/5+1)

STEPS = [ 5, 4, 3, 2, 1 ]

x = int(input())
result = 0

for i in STEPS:
	print i
	while True:
		if x - i >= 0:
			x -= i
			result += 1
		else:
			break

print result

n=int(input())
if n%5==0:
     print(n/5)
else:
     print(n%5+1)

def func(num):
    count=0
    lst=[5,4,3,2,1]
    for i in lst:
        quot= num//i
        if quot>0:
            count+=1
        num=num%i
        if num==0:
            return count
print(func(int(input())))

x = int(input())
if x%5 ==0:
    print(x/5)
else :
    print((x//5) +1)

import math

x = int(raw_input())

if x <= 2:
    print 0
elif x <= 5:
    print 1
elif x <= 10:
    print 2
elif x <= 15:
    print 3
else:
    print int(math.ceil(x * 1.0 / 5))

n = int(input())
x = 0
m = n
while m > 5:
    x = m//5
    m = 0
    if n < 5:
        print('1')
ans = x + 1
print(ans)

num = int(input(''))
if num <= 5:
    print(1)
else:
    print(1 + num//5)

coord = int(input())
steps = coord
count = 0
while(steps > 5):
	steps= -5
	count+=1
count+=1
print(count)

n=int(raw_input())
p=n/5
r=n%5-1
print p+r

a=(int(raw_input("a cuantos pasos vive tu amigo ?")))

b=a/5
b%=5
if(a%5!=0):
    b=b+1
print b

x = input()
c = 0

while x != 0:
    if x % 5 == 0:
        c += 1
        x -= 5
        continue
    if x % 4 == 0:
        c += 1
        x -= 4
        continue
    if x % 3 == 0:
        c += 1
        x -= 3
        continue
    if x % 2 == 0:
        c += 1
        x -= 2
        continue
    if x % 1 == 0:
        c += 1
        x -= 1
        continue

print c

n = int(input())

dis_remaining = n
num_of_steps = int(0)

for i in range(5, 1, -1):
    num_of_steps += dis_remaining // i
    dis_remaining = dis_remaining % i

print(num_of_steps)

n = input('enter: ')
n = int(n)

print(int((n+5+1) / 5))

import sys
x = 0

for line in sys.stdin:
    pass

i = 0

while x >= 0:
    if x >= 5:
        x = x-5
        i += 1
    elif x == 0:
        print(i)
        break
    else:
        x = 0
        i += 1
        print(i)
        break

cor = int(input())

steps = 0

while cor != 0:
    if cor >= 5:
        cor -= 5
        steps += 1
    if cor >= 4:
        cor -= 4
        steps += 1
    if cor >= 3:
        cor -= 3
        steps += 1
    if cor >= 2:
        cor -= 2
        steps += 1
    if cor >= 1:
        cor -= 1
        steps += 1

print(steps)

x = input()
length = list(range(1,5))
length.reverse()
steps = 0
for i in length:
            number = x/i
            steps += number
            x -= number * i

print steps

import math

xs=input('')
x=int(xs)
xc=math.ceil(x/5)
if xc<1:
    print('1')
else:
    print(xc+1)

n = int(input())
if(n%5==0):
   u = n/5
else:
   k = n/5
   u = k+1
print(u)

x = int(raw_input())
countsteps = 0

while(x!=0):
	if(x-5 >= 0):
		x -= 5
		countsteps += 1
	if(x-4 >= 0):
		x -= 4
		countsteps += 1
	if(x-3 >= 0):
		x -=3
		countsteps += 1
	if(x-2 >= 0):
		x -= 2
		countsteps += 1
	if(x-1 >= 0):
		x -= 1
		countsteps += 1
print countsteps

import math
def Elephant():
    x= int(input())
    p=0
    if(x<=5):
        return 1
    elif(x>5):
        if(x%5 == 0):
            p=x/5
        else:
            p=math.floor(x/5)+1
        return p

if __name__ == "__main__":
    print(Elephant())

i=int(input())
p=i//5
p=p+1
if i==0:
  p=0
print(p)

num = int(input())
answer = 0

for i in reversed(range(1, 6)):
    while num - i > 0:
        num -= i
        answer += 1
        print(answer, num, i)

print(answer)

x = int(input())
if x % 5 >= 4:
    print(x % 5 + 1)
else:
    print(x/5)

import math

xs=input('')
x=int(xs)
xc=math.ceil(x)
if xc<1:
    print('1')
else:
    print(xc+1)

n = int(input())
s = 0
if n > 5:
	s = (n/5)+1
else:
	s = (n/5)
print(int(s))

a=int(input())
c=a//5
if(a<5)or(a%5==0):
    print(c)
else:
    print(c+1)