#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef double D; typedef pair P; #define M 1000000007 #define F first #define S second #define PB push_back int y,m,d; char c; int u[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int main(void){ cin>>y>>c>>m>>c>>d; if(y%4==0){ if(y%100!=0)u[1]++; else if(y%400==0)u[1]++; } d+=2; if(u[m-1]