#include <iostream> #include <cstdio> #include <cmath> using namespace std; bool is_leap_year(int y) { if((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0)) return true; else return false; } int main() { int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int y, m, d, sum; while(~scanf("%d/%d/%d", &y, &m, &d)) { sum = 0; month[2] = is_leap_year(y) ? 29 : 28; for(int i = 1; i < m; ++ i) { sum += month[i]; } sum = sum + d; printf("%d ", sum); } return 0; }