#include<stdio.h>
int main(void)
{
	int y1,m1,d1,y2,m2,d2;
	while(scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2),y1>0)
	{
		int begin=y1+(m1>2), end=y2+(m2>2),c=0,i;
		for(i=begin;i<=end;++i)
			if(i%400==0 || i%100&&i%4==0)
				c++;
		int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
		for(i=1;i<m1;++i) d1+=a[i];
		for(i=1;i<m2;++i) d2+=a[i];
		printf("%d\n",(y2-y1-(d1>d2))*365+(d2-d1)+c);
	}
	return 0;
}