import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

int[] m = [31,28,31,30,31,30,31,31,30,31,30,31];

void main(){

    while(true){
	auto s = readln().split().to!(int[]);
	if(s[0] < 0 || s[1] < 0 || s[2] <0 || s[3] < 0 || s[4] < 0 || s[5] < 0){
	    break;
	}

	int ans = 365*(s[3] - s[0]);
	int u = s[3] / 4 - s[3] / 100 + s[3] / 400;
	u -= (s[0]) / 4 - (s[0]) / 100 + (s[0]) / 400;
	ans += u;
	for(int i=0;i<s[1]-1;i++){
	    ans -= m[i];
	}
	ans -= s[2];
	for(int i=0;i<s[4]-1;i++){
	    if(i == 1 && ( s[3] % 4 == 0 && (s[3] % 100 != 0 || (s[3] % 100== 0 && s[3] % 400 == 0)))){
		ans++;
	    }
	    ans += m[i];
	}
	if(s[0] % 4 == 0 && (s[0] % 100 != 0 || (s[0] % 100== 0 && s[0] % 400 == 0))) ans++;
	ans += s[5];
	writeln(ans);
    }

}