#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char strdate[254];
int day = 0, month = 0, year,A;
int yearh = 0;
int yearl = 0;
scanf("%s", strdate);
char *token = strtok(strdate, ".");
day = strtol(token, NULL, 10);
token = strtok(NULL, ".");
month = strtol(token, NULL, 10);
token = strtok(NULL, ".");
strncpy((char *)&year, token ,2);
yearh = strtol((char *)&year, NULL, 10);
if(month == 1 || month == 2)
yearl--;
int gauss_month[] = {11,12,1,2,3,4,5,6,7,8,9,10};
/* A=d+[2.6*m-0.2] + y + [y/4]+[c/4]-2*c */
A = day + (int)((double)2.6*gauss_month[month-1]-0.2) + yearl + (int)((double)yearl/4) + (int)((double)yearh/4) - 2 * yearh;
return 0;
}