candle-problem

Rajiv is given a problem in class. 
" Suppose N burnt candles together make a new candle. then how many new candles are created if we start with M candles"

Please refer to similar MCQ Question for clarification.

SAMPLE INPUT
121

SAMPLE OUTPUT
30

Source: hackerearth | Difficulty: EASY


Solutions:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'

a = eval(input())

d = 0
r = 0
res = 0
while(a/5 > 0):
	d = a/5
	r = a%5
	a = d+r
	res += d

print(res)


M = eval(input())
new = 0
count = 0
while M > 0:
	M -= 1
	count += 1
	if count == 5:
		new += 1
		M += 1
		count = 0

print(new)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'

a = eval(input())

d = 0
r = 0
res = 0
while(a/5 > 0):
	d = a/5
	r = a%5
	a = d+r
	res += d

print(res)