import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Scanner;
public class Main {
/**
* @param args
* @throws ParseException
*/
public static void main(String[] args) throws ParseException {
// TODO Auto-generated method stub
int y,m,d;
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String s;
Scanner cin=new Scanner(System.in);
while (cin.hasNext()) {
s=cin.next();
String a[] = s.split("/");
y=Integer.parseInt(a[0]);
m=Integer.parseInt(a[1]);
d=Integer.parseInt(a[2]);
// System.out.println(y+"+ "+m+" +"+d);
java.util.Date d1 = df.parse(y+"-"+m+"-"+d);
// System.out.println(d1);
java.util.Date d2 = df.parse(y+"-"+1+"-"+1);
long diff = d1.getTime() - d2.getTime();
long days = diff / (1000 * 60 * 60 * 24);
System.out.println(days+1);
}
}
}