// editor2
#include <iostream>
#include<string>
using namespace std;
bool isleap(int yearr){
    if ((yearr %400==0) || (yearr%4==0 && yearr%100 !=0))
    return true;
    return false;
}
int main(){
    string date;
    cin>>date;
    if (date.length()!=10 || date[4]!= '-' || date[7]!='-'){
        cout<<"Invalid input";
        return 0;
    }
    int year =stoi(date.substr(0,4));
    int month = stoi(date.substr(5,2));
    int year = stoi(date.substr(8,2));
    
    if (year<1990 || year> 2100 || month <1 || month>12 ||day<1||day>31){
        cout<<"invalid input";
        return 0;
    }
    int totaldays=0;
    for(int i=0;i<month-1:i++){
        totaldays+=daysinmonth[i];
    }
    totaldays+=day;
    cout<<totaldays;

    return 0;
}