# http://www.prologin.org/training/challenge/demi2014/42
from sys import stdin

dummy = int(stdin.readline())

print dummy/666
# http://www.prologin.org/training/challenge/demi2014/42
from sys import stdin

dummy = int(stdin.readline())

print dummy/666
# http://www.prologin.org/training/challenge/demi2014/42