import datetime
my_map = map(int, input().split(' '))
# You can also use *args and **kwargs to pass in 
# parameters from lists (or any iterable) and dicts (or any mapping)
ot=datetime.datetime(*my_map)
# strftime("%j"):Day of the year as a zero-padded decimal number.
ot=ot.strftime("%j").lstrip("0")

print(ot)