#!/usr/bin/python

import hashlib

# Part 1
n = 0
while hashlib.md5(b"ckczppom{0}".format(n)).hexdigest()[:5] != "00000":
	n += 1
print(n)

# Part 2
n = 0
while hashlib.md5(b"ckczppom{0}".format(n)).hexdigest()[:6] != "000000":
	n += 1
print(n)