import time
# Get two time strings separated by a comma
time1, time2 = input().split(',')
# Parse the time strings into datetime objects
day1 = time.strptime(time1, '%Y年%m月%d日%H点%M分%S秒')
day2 = time.strptime(time2, '%Y年%m月%d日%H点%M分%S秒')
# Calculate the difference in days
day_num = (int(time.mktime(day2) - time.mktime(day1)) / (24 * 60 * 60))
# Print the number of days as an integer
print(int(day_num))