#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
 
int E, S, M;
int e = 1;
int s = 1;
int m = 1;
int year = 1;
 
int main(void)
{
//    freopen("B1476_input.txt", "r", stdin);
    
    cin >> E >> S >> M;
    
    while(1)
    {    
        if(e > 15)
        {
            e = 1;
        }
        
        if(s > 28)
        {
            s = 1;
        }
        
        if(m > 19)
        {
            m = 1;
        }
        
        if(E == e && S == s && M == m)
        {
            cout << year;
            break;
        }
        
        e++;
        s++;
        m++;
        year++;
    }
    
    return 0;
}
cs

+ Recent posts