Calendars in widespread use today include the Gregorian calendar, which is the de facto international standard, and is used almost everywhere in the world for civil purposes. The Gregorian reform modified the Julian calendar's scheme of leap years as follows: Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100; the centurial years that are exactly divisible by 400 are still leap years. For example, the year 1900 is not a leap year; the year 2000 is a leap year.   In this problem, you have been given two dates and your task is to calculate how many days are between them. Note, that leap years have unusual number of days in February.Look at the sample to understand what borders are included in the aswer.

The first two lines contain two dates, each date is in the format yyyy:mm:dd (1900 ≤ yyyy ≤ 2038 and yyyy:mm:dd is a legal date).

Print a single integer — the answer to the problem.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i, j, year_1, m_1, day_1, year_2, m_2, day_2, k: Integer;
  s, ss: String;
  mas: array [1..12] of Integer;

Procedure Cnt_1;
begin
  i := 1;
  ss := '';
  while (s[i] <> ':') do
  begin
    ss := ss + s[i];
    Inc(i);
  end;
  year_1 := StrToInt(ss);
  Inc(i);
  ss := '';
  while (s[i] <> ':') do
  begin
    ss := ss + s[i];
    Inc(i);
  end;
  m_1 := StrToInt(ss);
  Inc(i);
  ss := '';
  while (i <= length(s)) do
  begin
    ss := ss + s[i];
    Inc(i);
  end;
  day_1 := StrToInt(ss);
end;

Procedure Cnt_2;
begin
  i := 1;
  ss := '';
  while (s[i] <> ':') do
  begin
    ss := ss + s[i];
    Inc(i);
  end;
  year_2 := StrToInt(ss);
  Inc(i);
  ss := '';
  while (s[i] <> ':') do
  begin
    ss := ss + s[i];
    Inc(i);
  end;
  m_2 := StrToInt(ss);
  Inc(i);
  ss := '';
  while (i <= length(s)) do
  begin
    ss := ss + s[i];
    Inc(i);
  end;
  day_2 := StrToInt(ss);
end;

Procedure Swap;
var
  k: Integer;
begin
  k := year_1;
  year_1 := year_2;
  year_2 := k;
  k := m_1;
  m_1 := m_2;
  m_2 := k;
  k := day_1;
  day_1 := day_2;
  day_2 := k;
end;

Procedure Min_max;
begin
  If (year_1 > year_2) then
    swap else
  If (year_1 = year_2) and (m_1 > m_2) then
    swap else
  If (year_1 = year_2) and (m_1 = m_2) and (day_1 > day_2) then
    swap;
end;

Procedure Filling;
begin
  mas[1] := 31;
  mas[2] := 28;
  mas[3] := 31;
  mas[4] := 30;
  mas[5] := 31;
  mas[6] := 30;
  mas[7] := 31;
  mas[8] := 31;
  mas[9] := 30;
  mas[10] := 31;
  mas[11] := 30;
  mas[12] := 31;
end;

begin
  {reset(input, 'in.in');
  rewrite(output, 'out.out');  }

  readln(s);
  Cnt_1;
  readln(s);
  Cnt_2;
  Filling;
  Min_max;
  k := 0;
  while (year_1 <> year_2) or (m_1 <> m_2) or (day_1 <> day_2) do
  begin
    If ((year_1 mod 4 = 0) and (year_1 mod 100 <> 0)) or ((year_1 mod 100 = 0) and (year_1 mod 400 = 0)) then
      mas[2] := 29
    else
      mas[2] := 28;
    Inc(k);
    Inc(day_1);
    If (mas[m_1] < day_1) then begin
      day_1 := 1;
      Inc(m_1);
    end;
    If (m_1 > 12) then begin
      m_1 := 1;
      Inc(year_1);
    end;
  end;
  writeln(k);
  readln;
  readln;
end.

program ProjectA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  month : array[1..12] of integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var
  date1, date2 : string;
  i, res, year1, year2, day1, day2, month1, month2 : integer;

procedure swap(var a, b : integer);
var
  t : integer;
begin
  t := a;
  a := b;
  b := t;
end;

function isfuck(a : integer) : boolean;
begin
  result := (a mod 400 = 0) or ((a mod 4 = 0) and (a mod 100 > 0));
end;

begin
  readln(date1);
  readln(date2);
  res := 0;
  year1 := strtoint(copy(date1, 1, 4));
  year2 := strtoint(copy(date2, 1, 4));
  month1 := strtoint(copy(date1, 6, 2));
  month2 := strtoint(copy(date2, 6, 2));
  day1 := strtoint(copy(date1, 9, 2));
  day2 := strtoint(copy(date2, 9, 2));
  if (year1 > year2) or ((year1 = year2) and (month1 > month2)) or ((year1 = year2) and (month1 = month2) and (day1 > day2)) then begin
    swap(year1, year2);
    swap(day1, day2);
    swap(month1, month2);
  end;
  for i := year1 + 1 to year2 - 1 do
    if isfuck(i) then
      inc(res, 366)
    else
      inc(res, 365);
  if (year1 < year2) then begin
    for i := month1 + 1 to 12 do
      if (i = 2) then
        if (isfuck(year1)) then
          inc(res, 29)
        else
          inc(res, 28)
      else
        inc(res, month[i]);
    for i := 1 to month2 - 1 do
      if (i = 2) then
        if (isfuck(year2)) then
          inc(res, 29)
        else
          inc(res, 28)
      else
        inc(res, month[i]);
    if (month1 = 2) then
      if (isfuck(year1)) then
        inc(res, 30 - day1)
      else
        inc(res, 29 - day1)
    else
      inc(res, month[month1] + 1 - day1);
    inc(res, day2);
  end else
    if (month1 < month2) then begin
      for i := month1 + 1 to month2 - 1 do
        if (i = 2) then
          if (isfuck(year1)) then
            inc(res, 29)
          else
            inc(res, 28)
        else
          inc(res, month[i]);
      if (month1 = 2) then
        if (isfuck(year1)) then
          inc(res, 30 - day1)
        else
          inc(res, 29 - day1)
      else
        inc(res, month[month1] + 1 - day1);
      inc(res, day2);
    end else
      inc(res, day2 - day1 + 1);
  writeln(res - 1);
end.

program B304;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s,s1:string;
  a:array[1..12] of integer;
  i,g,m,d,g1,m1,d1,c,j,sum:integer;
procedure obmen;
  var
    c:integer;
  begin
    c:=g; g:=g1; g1:=c;
    c:=m; m:=m1; m1:=c;
    c:=d; d:=d1; d1:=c;
  end;
begin
  readln(s);
  readln(s1);
  a[1]:=31; a[2]:=28; a[3]:=31; a[4]:=30; a[5]:=31; a[6]:=30;
  a[7]:=31; a[8]:=31; a[9]:=30; a[10]:=31; a[11]:=30; a[12]:=31;
  val(s,g,c); delete(s,1,5);
  val(s,m,c); delete(s,1,3);
  val(s,d,c);
  val(s1,g1,c); delete(s1,1,5);
  val(s1,m1,c); delete(s1,1,3);
  val(s1,d1,c);
  if g1<g then obmen
    else if (m1<m)and(g1=g) then obmen
      else if (d1<d)and(m1=m)and(g1=g) then obmen;
  {writeln(g,':',m,':',d,'  -  ',g1,':',m1,':',d1);     }
  sum:=0;
  for i:=g to g1 do
    if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            if m=2 then inc(sum,a[m]+1-d)
                   else inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); if m=2 then inc(sum,a[m]+1-d)
                   else inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,366);
      end
                                                     else
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,365);
      end;
  writeln(sum);
  readln;   readln;
end.

uses math,sysutils,DateUtils;
var r,kol,xv,l,d,res,min1,z,j,max1,l1:integer;x3,y3,x1,y1,x2,y2,x,y,i,k:integer;
    ch:char;s,s1,ss:string;e,code,n,e1,c,g,g1,h,h1,m,m1:integer;u:boolean;
    v,v1:real;a,b:TDateTime;
begin
 // assign(input,'input.txt');
 // assign(output,'output.txt');
  readln(s);
  val(copy(s,1,4),g,code);
  val(copy(s,6,2),h,code);
  val(copy(s,9,2),m,code);
  readln(s);
  val(copy(s,1,4),g1,code);
  val(copy(s,6,2),h1,code);
  val(copy(s,9,2),m1,code);
  a:=EncodeDateTime(g,h,m,0, 0, 0, 0);
  b:=EncodeDateTime(g1,h1,m1,0, 0, 0, 0);
  writeln(daysbetween(a,b));
end.

program Project666;

{$APPTYPE CONSOLE}

uses math,sysutils;

 var m: integer;
    i,j: integer;
    y1,m1,d1,y2,m2,d2,d: integer;
    date1,date2,s: string;
    a: array[1..12] of integer;

    function substr(s: string; n,m: integer):integer;
    var str: string;
        i: integer;
        a,d: integer;
    begin
        d := 1;
        a := 0;
        for i := m downto n do
                begin
                   //     writeln(a);
                        a := a + ( StrToInt(s[i]) * d );
                        d := d*10;
                end;
        substr := a;
    end;

begin

   a[1] := 31;
   a[2] := 28;
   a[3] := 31;
   a[4] := 30;
   a[5] := 31;
   a[6] := 30;
   a[7] := 31;
   a[8] := 31;
   a[9] := 30;
   a[10] := 31;
   a[11] := 30;
   a[12] := 31;

   readln(date1);
   readln(date2);

   y1 := substr(date1,1,4);
   y2 := substr(date2,1,4);

   m1 := substr(date1,6,7);
   m2 := substr(date2,6,7);

   d1 := substr(date1,9,10);
   d2 := substr(date2,9,10);

   if y1 > y2 then
        begin
                d := y1;
                y1 := y2;
                y2 := d;

                d := m1;
                m1 := m2;
                m2 := d;

                d := d1;
                d1 := d2;
                d2 := d;

        end;

        if ( y1 = y2 ) and (m1 > m2) then
        begin

                d := m1;
                m1 := m2;
                m2 := d;

                d := d1;
                d1 := d2;
                d2 := d;

        end;

        if ( y1 = y2 ) and (m1 = m2) and (d1 > d2) then
        begin

                d := d1;
                d1 := d2;
                d2 := d;

        end;

    d := 0;

    for i := y1 to y2-1 do
        if (i MOD 4 = 0) and  ( i MOD 100 <> 0 ) then
                d := d + 366
        else if (i MOD 4 = 0) and ( i MOD 400 = 0 ) then
                d := d + 366
        else d := d + 365;

    for i := 2 to m1 do
        if (i = 3) then
                begin
                        d := d - 28;
                        if (y1 MOD 4 = 0) and (y1 MOD 100 <> 0)
                                or (y1 MOD 4 = 0) and (y1 MOD 400 = 0) then
                                        d := d-1;
                end
        else
                d := d - a[i-1];

     for i := 2 to m2 do
        if (i = 3) then
                begin
                        d := d + 28;
                        if (y2 MOD 4 = 0) and (y2 MOD 100 <> 0)
                                or (y2 MOD 4 = 0) and (y2 MOD 400 = 0) then
                                        d := d+1;
                end
        else
                d := d + a[i-1];

        d := d - d1 + d2;

    write(d);

end.

program z1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  i,j: longint;
  a: array[1900..2038] of longint;
  s1,s2: string;

function dtoch(s: string): longint;
var d,m,g,ans: longint;
begin
  g:=strtoint(copy(s,1,4));
  ans:=a[g];
  m:=strtoint(copy(s,6,2));
  if m>1 then ans:=ans+31;
  if m>2 then begin if ((g mod 4=0) and (g mod 100<>0)) or (( g mod 1000 mod 400=0 ) ) then ans:=ans+29 else ans:=ans+28; end;
  if m>3 then ans:=ans+31;
  if m>4 then ans:=ans+30;
  if m>5 then ans:=ans+31;
  if m>6 then ans:=ans+30;
  if m>7 then ans:=ans+31;
  if m>8 then ans:=ans+31;
  if m>9 then ans:=ans+30;
  if m>10 then ans:=ans+31;
  if m>11 then ans:=ans+30;
  d:=strtoint(copy(s,9,2));
  ans:=ans+d;
  dtoch:=ans;
end;

begin
 //assign(input,'input.txt'); reset(input);  assign(output,'output.txt'); rewrite(output);
 readln(s1);
 readln(s2);

 a[1900]:=0;

 for i:=1901 to 2038 do
  if ((  (i-1) mod 4=0) and (  (i-1) mod 100<>0)) or (( (i-1) mod 1000 mod 400=0 ) ) then a[i]:=a[i-1]+366 else a[i]:=a[i-1]+365;

 writeln(abs(dtoch(s1)-dtoch(s2)));

end.

                          {$APPTYPE CONSOLE}
const  besk=1000000000;
   nnn=2000000;  eps=1e-13;
 label 1,2,3,4;
var n1,n,m,dl,kol,ii,jj,i3,i2,i1,j1,k1,p1,p2,kt,ppp,god,day,mon,mask,i0,j0,k,step,i,j,start,finish:longint;
cc,dd,t,chisl,znam,ot,aa,bb,x0,y0,ll,rr,d1,d2,rad,yy1,xx1,xx2,q,xx,yy,t1,t2,p,modul,pp,tt,ot1,ot2,s,kold,kkr:int64;
mon1,mon2,day1,day2,god1,god2,plus,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
minotkl,dl1,dl2,dl3,hh,po,pt,doltek,dolpred:extended;
kolday,b,a,c:array[-10..2000000] of int64;

x1,y1,z1,z,gr,x,y: array[-10..50000] of double;
visok,zan: array[-10..11000] of boolean;
ee,ww,nn,marked:array[-100000..250000] of int64;
{ss:array[0..2000000] of char; }
sss:string;
ch11,ch12,ch1,ch:char;
sl,sr,stoim,str :array[-10 ..200000] of int64;
ssot:array[-1000..1100000] of char;
fact:array[0..100] of extended;
name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

    function nod(a,b:int64):int64; var p,t:int64;
begin if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function deg(a,k:int64):int64; var p:int64;
begin
 if k=0 then deg:=1 else if odd(k) then deg:=deg(a,k-1)*a mod modul else
   begin  p:=deg(a,k div 2); deg:=p*p mod modul;   end;

end;

function koldday(god,mon,day:int64):int64; var ot,i,j,k:longint;
begin
 ot:=0;
for i:=1900 to god-1 do for j:=1 to 12 do ot:=ot+kolday[j];
for i:=1900 to god-1 do if visok[i] then inc(ot);
for i:=1 to mon-1 do  ot:=ot+kolday[i];
if visok[god] and(mon>2) then inc(ot);
ot:=ot+day;
koldday:=ot;
end;

begin
  {  assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
                              modul:=1000000007 ;

for i:=1 to 4 do read(ssot[i]);
for i:=1 to 4 do god1:=10*god1+(ord(ssot[i])-48);
read(ch);
for i:=1 to 2 do read(ssot[i]);
for i:=1 to 2 do mon1:=10*mon1+(ord(ssot[i])-48);
read(ch);
for i:=1 to 2 do read(ssot[i]);
for i:=1 to 2 do day1:=10*day1+(ord(ssot[i])-48);
readln;
{writeln(god1);
writeln(mon1);
writeln(day1);
}
for i:=1 to 4 do read(ssot[i]);
for i:=1 to 4 do god2:=10*god2+(ord(ssot[i])-48);
read(ch);
for i:=1 to 2 do read(ssot[i]);
for i:=1 to 2 do mon2:=10*mon2+(ord(ssot[i])-48);
read(ch);
for i:=1 to 2 do read(ssot[i]);
for i:=1 to 2 do day2:=10*day2+(ord(ssot[i])-48);
readln;
{writeln(god2);
writeln(mon2);
writeln(day2);
}
for i:=0 to 2000 do visok[4*i]:=true;
visok[1900]:=false;
{for i:=1890 to 2050 do if visok[i] then write(i,' ');writeln;
}
kolday[1]:=31;
kolday[2]:=28;
kolday[3]:=31;

kolday[4]:=30;
kolday[5]:=31;
kolday[6]:=30;

kolday[7]:=31;
kolday[8]:=31;
kolday[9]:=30;

kolday[10]:=31;
kolday[11]:=30;
kolday[12]:=31;

{ for i:=1900 to 1906 do for j:=1 to 12 do for k:=1 to 31 do
 writeln(i,' ',j,' ',k,' ',koldday(i,j,k));
}

 writeln(abs(koldday(god1,mon1,day1)-koldday(god2,mon2,day2)));

   1:          close(output);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s1, s2: string;
  d1, d2, m1, m2, y1, y2: integer;

function isBig(n: integer):boolean;
begin
  if (n mod 400 = 0) or ((n mod 4 = 0) and (n mod 100 <> 0)) then
    result := true
  else
    result := false;
end;

function CheckDay(day, month, year: integer): boolean;
begin
  if ((day > 30) and (month in [2,4,6,9,11])) or
     ((day > 29) and (month = 2)) or
     ((day > 28) and (month = 2) and (not isBig(year))) then
       result := false
  else
    result := true;
end;

function DaysFromZero(y, m, d: integer): integer;
var
  yn, dn, mn: integer;
begin
  yn := 1899;
  dn := 1;
  mn := 1;

  result := 0;
  while true do begin
    inc(result);
    inc(dn);
    if (dn > 31) or not CheckDay(dn, mn, yn) then begin
      dn := 1;
      inc(mn);
    end;
    if mn > 12 then begin
      mn := 1;
      dn := 1;
      inc(yn);
    end;
    if (dn = d) and (yn = y) and (mn = m) then break;
  end;
end;

begin
  //reset(input, 'a.in');
  //rewrite(output, 'a.out');
  readln(s1);
  y1 := strtoint(copy(s1, 1, 4));
  m1 := strtoint(copy(s1, 6, 2));
  d1 := strtoint(copy(s1, 9, 2));
  readln(s2);
  y2 := strtoint(copy(s2, 1, 4));
  m2 := strtoint(copy(s2, 6, 2));
  d2 := strtoint(copy(s2, 9, 2));
  //writeln(DaysFromZero(y1, m1, d1));
  //writeln(DaysFromZero(y2, m2, d2));
  writeln(abs(DaysFromZero(y1, m1, d1) - DaysFromZero(y2, m2, d2)));
end.

program z1;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;
const
ny:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
vy:array[1..12] of longint=(31,29,31,30,31,30,31,31,30,31,30,31);

function vis(x:longint):boolean;
begin
 if (x mod 100=0) and (x mod 400=0) or (x mod 100<>0) and (x mod 4=0) then vis:=true else vis:=false;
end;

var
ss,s1,s2:string;
i,k,m1,m2,d1,d2,y1,y2:longint;
begin
//assign(input,'input.txt'); reset(input); assign(output,'output.txt'); rewrite(output);
readln(s1); readln(s2);
if s1>s2 then begin ss:=s1; s1:=s2; s2:=ss end;
y1:=strtoint(copy(s1,1,4)); y2:=strtoint(copy(s2,1,4));
m1:=strtoint(copy(s1,6,2)); m2:=strtoint(copy(s2,6,2));
d1:=strtoint(copy(s1,9,2)); d2:=strtoint(copy(s2,9,2));

k:=0;
if vis(y1) then
begin
 for i:=1 to m1-1 do k:=k+vy[i];
 k:=k+d1;
 k:=366-k;
end
else
begin
 for i:=1 to m1-1 do k:=k+ny[i];
 k:=k+d1;
 k:=365-k;
end;

if vis(y2) then
begin
 for i:=1 to m2-1 do k:=k+vy[i];
 k:=k+d2;
end
else
begin
 for i:=1 to m2-1 do k:=k+ny[i];
 k:=k+d2;
end;

if y1=y2 then begin
if vis(y1) then k:=k-366 else k:=k-365;
end;

inc(y1); dec(y2);
for i:=y1 to y2 do if vis(i) then k:=k+366 else k:=k+365;
writeln(k);
end.

uses SysUtils, DateUtils;
var s1,s2:string;
y1,m1,d1,y2,m2,d2:longint;
begin
  //Assign(input,'input.txt'); reset(input);
  //Assign(output,'output.txt'); rewrite(output);
  readln(s1);
  readln(s2);
  y1 := StrToInt(Copy(s1, 1, 4));
  m1 := StrToInt(Copy(s1, 6, 2));
  d1 := StrToInt(Copy(s1, 9, 2));
  y2 := StrToInt(Copy(s2, 1, 4));
  m2 := StrToInt(Copy(s2, 6, 2));
  d2 := StrToInt(Copy(s2, 9, 2));
  Writeln(DaysBetween(EncodeDateTime(y1, m1, d1, 0, 0, 0, 0), EncodeDateTime(y2, m2, d2, 0, 0, 0, 0)));
end.

{$APPTYPE CONSOLE}
{$O-}

uses
  SysUtils,
  Math;

var
  s1, s2: string;
  f, y1, y2, d1, d2, m1, m2, ans: integer;

function vis(x: integer): boolean;
begin
  vis := ((x mod 4 = 0) and (x mod 100 <> 0)) or (x mod 400 = 0);
end;

procedure make(s: string; var a, b, c: integer);
begin
  a := strtoint(s[1] + s[2] + s[3] + s[4]);
  b := strtoint(s[6] + s[7]);
  c := strtoint(s[9] + s[10]);
end;

procedure swap(var a, b: integer);
var
  c: integer;
begin
  c := a;
  a := b;
  b := c;
end;

function endm(x, y: integer): integer;
begin
  case x of
    1, 3, 5, 7, 8, 10, 12: endm := 31;
    4, 6, 9, 11: endm := 30;
    2: if vis(y) then endm := 29 else endm := 28;
  end;
end;

begin
  //reset(input, 'input.txt');
  //rewrite(output, 'output.txt');
  readln(s1);
  read(s2);
  make(s1, y1, m1, d1);
  make(s2, y2, m2, d2);
  if y1 > y2 then begin
    swap(y1, y2);
    swap(m1, m2);
    swap(d1, d2);
  end;
  if (y1 = y2) and (m1 > m2) then begin
    swap(m1, m2);
    swap(d1, d2);
  end;
  if (y1 = y2) and (m1 = m2) and (d1 > d2) then
    swap(d1, d2);
  ans := 0;
  f := endm(m1, y1);
  while y1 <> y2 do begin
    if d1 = f then begin
      if m1 = 12 then begin
        inc(y1);
        m1 := 1;
        f := endm(m1, y1);
        d1 := 1;
        inc(ans);
        continue;
      end;
      inc(m1);
      f := endm(m1, y1);
      d1 := 1;
      inc(ans);
      continue;
    end;
    inc(d1);
    inc(ans);
  end;
  while m1 <> m2 do begin
    if d1 = f then begin
      if m1 = 12 then begin
        inc(y1);
        m1 := 1;
        f := endm(m1, y1);
        d1 := 1;
        inc(ans);
        continue;
      end;
      inc(m1);
      f := endm(m1, y1);
      d1 := 1;
      inc(ans);
      continue;
    end;
    inc(d1);
    inc(ans);
  end;
  inc(ans, d2 - d1);
  write(ans);
end.

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils;
Var
   r:Array[1..12] of Integer=(31,28,31,30,31,30,31,31,30,31,30,31);
   s1,s2:String;
   y1,m1,d1,y2,m2,d2,ans:Integer;
Procedure Swap(Var x,y:Integer);
Var t:Integer;
Begin
   t:=x;
   x:=y;
   y:=t;
End;
Begin
   ReadLn(s1);
   Read(s2);
   y1:=strtoint(s1[1]+s1[2]+s1[3]+s1[4]);
   m1:=strtoint(s1[6]+s1[7]);
   d1:=strtoint(s1[9]+s1[10]);
   y2:=strtoint(s2[1]+s2[2]+s2[3]+s2[4]);
   m2:=strtoint(s2[6]+s2[7]);
   d2:=strtoint(s2[9]+s2[10]);
   If (y1>y2) or ((y1=y2) and (m1>m2)) or ((y1=y2) and (m1=m2) and (d1>d2)) Then Begin
      Swap(y1,y2);
      Swap(m1,m2);
      Swap(d1,d2);
   End;
   ans:=0;
   While True Do Begin
      If (y1=y2) and (d1=d2) and (m1=m2) Then Break;
      ans:=ans+1;
      If (d1=29) and (m1=2) Then Begin
         m1:=m1+1;
         d1:=1;
         Continue;
      End;
      If d1=r[m1] Then Begin
         If (m1=2) and (d1=28) and ((y1 mod 4=0) and ((y1 mod 100<>0) or (y1 mod 400=0))) Then d1:=d1+1
         Else Begin
            If m1=12 Then Begin
               y1:=y1+1;
               m1:=1;
               d1:=1;
            End
            Else Begin
               m1:=m1+1;
               d1:=1;
            End;
         End;
      End
      Else d1:=d1+1;
   End;
   Write(ans);
End.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils, DateUtils;

var
  s1, s2: string;
  y1, m1, d1, y2, m2, d2: integer;

begin
  readln(s1);
  readln(s2);

  y1 := StrToInt(Copy(s1, 1, 4));
  m1 := StrToInt(Copy(s1, 6, 2));
  d1 := StrToInt(Copy(s1, 9, 2));

  y2 := StrToInt(Copy(s2, 1, 4));
  m2 := StrToInt(Copy(s2, 6, 2));
  d2 := StrToInt(Copy(s2, 9, 2));

  WriteLn(DaysBetween(EncodeDateTime(y1, m1, d1, 0, 0, 0, 0), EncodeDateTime(y2, m2, d2, 0, 0, 0, 0)));
end.

const
        fi = '';
        fo = '';
        ngay : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var
        d1,m1,y1,d2,m2,y2,p,code,i,j,nn,nt,t : longint;
        phu,s : string;

procedure swap(var x,y : longint);
var
        p : longint;
begin
        p := x;
        x := y;
        y := p;
end;

function ktnamnhuan(i:longint):longint;
begin
        if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then ktnamnhuan := 1
        else ktnamnhuan := 0;
end;

procedure xuat(t:longint);
begin
        assign(output,fo);
        rewrite(output);
        writeln(t);
        close(output);
        halt;
end;

begin
        assign(input,fi);
        reset(input);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y1=0 then val(phu,y1,code)
                        else val(phu,m1,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d1,code);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y2=0 then val(phu,y2,code)
                        else val(phu,m2,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d2,code);
        close(input);

        if (y1 > y2) or ((y1 = y2) and (m1 > m2)) or ((y1 = y2) and (m1 = m2) and (d1 > d2)) then
        begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i := y1 to y2 do
        begin
            p := ktnamnhuan(i);
            t := t+365+p;
        end;
        p := ktnamnhuan(y1);
        for i := 1 to m1-1 do
            if i <> 2 then t := t-ngay[i]
            else t := t-ngay[i]-p;
        t := t-d1;
        p := ktnamnhuan(y2);
        for i := m2+1 to 12 do
            if i <> 2 then t := t-ngay[i]
            else t := t-ngay[i]-p;
        if m2 <> 2 then t := t-(ngay[m2]-d2)
        else t := t-(ngay[m2]+p-d2);
        xuat(t);
end.

var
  v:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
  sum:array[0..12] of longint;
  i,j,k,n,m,x1,y1,z1,x2,y2,z2:longint;
  ans:int64;
  s1,s2:string;

Procedure Solve;
var
  k,x:longint;
  s:string;
begin
  if s1>s2 then
    begin
      s:=s1;
      s1:=s2;
      s2:=s;
    end;
  s:=Copy(s1,1,4);
  val(s,x1,x);
  s:=Copy(s1,6,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y1,x);
  s:=Copy(s1,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z1,x);
  s:=Copy(s2,1,4);
  val(s,x2,x);
  s:=Copy(s2,6 ,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y2,x);
  s:=Copy(s2,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z2,x);
end;

Function Run(x:longint):boolean;
begin
  if x mod 4<>0 then exit(false);
  if x mod 400=0 then exit(True);
  if x mod 100=0 then exit(false);
  exit(true);
end;

Begin
  readln(s1);
  readln(s2);
  Solve;
  for i:=1 to 12 do sum[i]:=sum[i-1]+v[i];
  ans:=0;
  if x1<x2 then
    begin
      ans:=ans+v[y1]-z1+1;
      ans:=ans+sum[12]-sum[y1];
      for i:=x1+1 to x2-1 do
        if  Run(i) then ans:=ans+sum[12]+1
                   else ans:=ans+sum[12];
      ans:=ans+sum[y2-1];
      ans:=ans+z2;
      if Run(x1) then
        begin
         if y1<=2 then inc(ans);
        end;
      if Run(x2) then
        begin
          if (y2>2) then inc(ans);
        end;
    end
           else
    begin
      if y1<y2 then
        begin
          ans:=ans+v[y1]-z1+1;
          ans:=ans+Sum[y2-1]-Sum[y1];
          ans:=ans+z2;
        end
               else
        begin
          ans:=z2-z1+1;
        end;
      if Run(x1) and (y1<=2) and (y2>2) then inc(ans);
    end;

  writeln(ans-1);
end.

var s:string;
n,t,y,r,n1,y1,r1,x:longint;
function p(x,y:longint):longint;
begin
case y of
  1,3,5,7,8,10,12:p:=31;
  4,6,9,11:p:=30;
  2:if (x mod 4=0)and(x mod 100<>0)or(x mod 400=0) then p:=29
    else p:=28;
  end;
end;
begin
//assign(input,'rl.in');reset(input);
//assign(output,'rl.out');rewrite(output);
readln(s);
val(copy(s,1,4),n);delete(s,1,5);
val(copy(s,1,2),y);delete(s,1,3);
val(copy(s,1,2),r);
readln(s);
val(copy(s,1,4),n1);delete(s,1,5);
val(copy(s,1,2),y1);delete(s,1,3);
val(copy(s,1,2),r1);
if (n>n1)or(n=n1)and(y>y1)or(n=n1)and(y=y1)and(r>r1) then
  begin
  t:=n;n:=n1;n1:=t;
  t:=y;y:=y1;y1:=t;
  t:=r;r:=r1;r1:=t;
  end;
while (n<>n1)or(y<>y1)or(r<>r1) do
  begin
  x:=x+1;
  r:=r+1;
  if r>p(n,y) then
    begin
    r:=1;y:=y+1;
    end;
  if y>12 then
    begin
    y:=1;n:=n+1;
    end;
  end;
writeln(x);
close(input);close(output);
end.

var x1,x2,x3,y1,y2,y3,i,ansx,ansy,j:longint;
x,y:string;
begin
//assign(input,'rl.in');reset(input);
//assign(output,'rl.out');rewrite(output);
readln(x);x:=x+':';
val(copy(x,1,pos(':',x)-1),x1);delete(x,1,pos(':',x));
val(copy(x,1,pos(':',x)-1),x2);delete(x,1,pos(':',x));
val(copy(x,1,pos(':',x)-1),x3);delete(x,1,pos(':',x));
readln(y);y:=y+':';
val(copy(y,1,pos(':',y)-1),y1);delete(y,1,pos(':',y));
val(copy(y,1,pos(':',y)-1),y2);delete(y,1,pos(':',y));
val(copy(y,1,pos(':',y)-1),y3);delete(y,1,pos(':',y));
ansx:=ansx+x3;ansy:=ansy+y3;
for i:=1 to x2-1 do
  if i in [1,3,5,7,8,10,12] then ansx:=ansx+31
  else if i in [4,6,9,11] then ansx:=ansx+30
  else if (x1 mod 4=0) and (x1 mod 100<>0) or (x1 mod 400=0) then ansx:=ansx+29
  else ansx:=ansx+28;
for i:=1 to y2-1 do
  if i in [1,3,5,7,8,10,12] then ansy:=ansy+31
  else if i in [4,6,9,11] then ansy:=ansy+30
  else if (y1 mod 4=0) and (y1 mod 100<>0) or (y1 mod 400=0) then ansy:=ansy+29
  else ansy:=ansy+28;
if x1>y1 then
  for j:=y1 to x1-1 do
    if (j mod 4=0) and (j mod 100<>0) or (j mod 400=0) then ansx:=ansx+366
    else ansx:=ansx+365
else
  for j:=x1 to y1-1 do
    if (j mod 4=0) and (j mod 100<>0) or (j mod 400=0) then ansy:=ansy+366
    else ansy:=ansy+365;
write(abs(ansx-ansy));
close(input);close(output);
end.

const g:array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var s,s1:string;
    a:array[1..5000] of longint;
    i,j,sum1,sum2,k,l,m,n,y1,y2,m1,m2,d1,d2,q,cod:longint;
begin
  readln(s);
  readln(s1);

 for i:=1 to 2038 do
  if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then a[i]:=1;
  q:=1000;
 for i:=1 to 4 do
  begin
    val(s[i],k,cod);
    val(s1[i],l,cod);
    y1:=y1+k*q;
    y2:=y2+l*q;
    q:=q div 10;
  end;
   q:=10;
   k:=0;
   l:=0;
  for i:=6 to 7 do
   begin
     val(s[i],k,cod);
     val(s1[i],l,cod);
     m1:=m1+k*q;
     m2:=m2+l*q;
     q:=q div 10;
    end;
   q:=10;
   k:=0;
   l:=0;
  for i:=9 to 10 do
   begin
     val(s[i],k,cod);
     val(s1[i],l,cod);
     d1:=d1+k*q;
     d2:=d2+l*q;
     q:=q div 10;
   end;
sum1:=d1;
for i:=m1-1 downto 1 do
sum1:=sum1+g[i];
sum1:=sum1+y1*365;
for i:=1 to y1 do
if a[i]<>0 then inc(sum1);
if (a[y1]<>0) and (m1<3) then dec(sum1);
sum2:=d2;
for i:=m2-1 downto 1 do
sum2:=sum2+g[i];
sum2:=sum2+y2*365;
for i:=1 to y2 do
if a[i]<>0 then inc(sum2);
if (a[y2]<>0) and (m2<3) then dec(sum2
);
write(abs(sum1-sum2));
end.

const days :array[1..12]of longint =(31,28,31,30,31,30,31,31,30,31,30,31);
      dayv :array[1..12]of longint =(31,29,31,30,31,30,31,31,30,31,30,31);
var s1,s2,t :string;
    y1,y2,m1,m2,d1,d2,d,m,y :longint;
    ans :int64;
Function vis(a :longint): boolean;
Begin
  if (a mod 400)=0 then exit(true);
  if (a mod 100)=0 then exit(false);
  if (a mod 4)=0 then exit(true);
  exit(false);
end;
Begin
  readln(s1);
  readln(s2);
  if s1>s2 then
  Begin
    t:=s1;
    s1:=s2;
    s2:=t;
  end;
  val(copy(s1,1,4),y1);
  val(copy(s2,1,4),y2);
  val(copy(s1,6,2),m1);
  val(copy(s2,6,2),m2);
  val(copy(s1,9,2),d1);
  val(copy(s2,9,2),d2);
  if y1=y2 then
  Begin
    ans:=0;
    if vis(y1) then
    Begin
      for m:=m1+1 to m2-1 do
        inc(ans,dayv[m]);
      if m1=m2 then
        inc(ans,d2-d1+1)
      else
      Begin
        inc(ans,dayv[m1]-d1+1);
        inc(ans,d2);
      end;
    end else
    Begin
      for m:=m1+1 to m2-1 do
        inc(ans,days[m]);
      if m1=m2 then
        inc(ans,d2-d1+1)
      else
      Begin
        inc(ans,days[m1]-d1+1);
        inc(ans,d2);
      end;
    end;
    writeln(ans-1);
    halt;
  end;
  ans:=0;
  for y:=y1+1 to y2-1 do
    if vis(y) then inc(ans,366) else inc(ans,365);
  for m:=12 downto m1+1 do
    if vis(y1) then inc(ans,dayv[m])
               else inc(ans,days[m]);
  if vis(y1) then
    for d:=dayv[m1] downto d1 do inc(ans)
  else
    for d:=days[m1] downto d1 do inc(ans);
  if vis(y2) then
  Begin
    for m:=1 to m2-1 do inc(ans,dayv[m]);
    inc(ans,d2);
  end else
  Begin
    for m:=1 to m2-1 do inc(ans,days[m]);
    inc(ans,d2);
  end;
  writeln(ans-1);
end.

var y,m,d,yx,mx,dx,tip,ans,i:longint;
    s:string;

begin
  readln(s);
  for i:=1 to 4 do y:=y*10+ord(s[i])-ord('0');
  for i:=6 to 7 do m:=m*10+ord(s[i])-ord('0');
  for i:=9 to 10 do d:=d*10+ord(s[i])-ord('0');

  readln(s);
  for i:=1 to 4 do yx:=yx*10+ord(s[i])-ord('0');
  for i:=6 to 7 do mx:=mx*10+ord(s[i])-ord('0');
  for i:=9 to 10 do dx:=dx*10+ord(s[i])-ord('0');

  if (y>yx) or ((y=yx) and (m>mx)) or ((y=yx) and (m=mx) and (d>dx)) then
  begin
     tip:=y; y:=yx; yx:=tip;
     tip:=d; d:=dx; dx:=tip;
     tip:=m; m:=mx; mx:=tip;
  end;
  while (y<>yx) or (m<>mx) or (d<>dx) do
  begin

    inc(ans);
    inc(d);
    if (m=2) then
    begin
      tip:=28;
      if (y mod 4=0) then tip:=29;
      if (y mod 100=0) and (y mod 400<>0) then tip:=28;
    end else
    begin
      if m in[1,3,5,7,8,10,12] then tip:=31 else tip:=30;
    end;
    if d>tip then
    begin
      inc(m); d:=1;
    end;
    if m>12 then
    begin
      m:=1; inc(y);
    end;
  end;
  writeln(ans);
end.

const
  d:array[1..12]of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var
  t,ts,i,x,y,z,a,pp,qq:longint;
  st,ss,s,s1:string;
function r(i:longint):longint;
begin
  if (i mod 4=0) and (i mod 100<>0) or (i mod 400=0) then
    exit(366) else
    exit(365);
end;
procedure p(x:longint);
begin
  pp:=x;
end;
procedure q(x:longint);
begin
  qq:=x;
end;
begin
  t:=1;
  st:='1926:08:17';
  for ts:=1 to t do
  begin
    readln(s);
    ss:=s;
    if s=st then
      p(0) else
    if s>st then
    begin
      a:=0;
      s1:=copy(s,1,4);
      val(s1,x);
      s1:=copy(s,6,2);
      val(s1,y);
      s1:=copy(s,9,2);
      val(s1,z);
      if x=1926 then
      begin
        if y=8 then
        begin
          p(z-17);
          continue;
        end;
        a:=14;
        for i:=9 to y-1 do
          a:=a+d[i];
        a:=a+z;
        p(a);
      end else
      begin
        a:=136;
        for i:=1927 to x-1 do
          a:=a+r(i);
        for i:=1 to y-1 do
          if i=2 then
          begin
            if r(x)=366 then
              a:=a+29 else
              a:=a+28;
          end else
            a:=a+d[i];
        a:=a+z;
        p(a);
      end;
    end else
    begin
      a:=0;
      s1:=copy(s,1,4);
      val(s1,x);
      s1:=copy(s,6,2);
      val(s1,y);
      s1:=copy(s,9,2);
      val(s1,z);
      if x=1926 then
      begin
        if y=8 then
        begin
          p(17-z);
          continue;
        end;
        a:=17;
        for i:=y+1 to 7 do
          a:=a+d[i];
        a:=a+d[y]-z;
        p(a);
      end else
      begin
        a:=229;
        for i:=x+1 to 1925 do
          a:=a+r(i);
        for i:=12 downto y+1 do
          if i=2 then
          begin
            if r(x)=366 then
              a:=a+29 else
              a:=a+28;
          end else
            a:=a+d[i];
        a:=a+d[y]-z;
        p(a);
      end;
    end;
    x:=0;
    y:=0;
    z:=0;
    a:=0;
    readln(s);
    if s=st then
      q(0) else
    if s>st then
    begin
      a:=0;
      s1:=copy(s,1,4);
      val(s1,x);
      s1:=copy(s,6,2);
      val(s1,y);
      s1:=copy(s,9,2);
      val(s1,z);
      if x=1926 then
      begin
        if y=8 then
        begin
          q(z-17);
          continue;
        end;
        a:=14;
        for i:=9 to y-1 do
          a:=a+d[i];
        a:=a+z;
        q(a);
      end else
      begin
        a:=136;
        for i:=1927 to x-1 do
          a:=a+r(i);
        for i:=1 to y-1 do
          if i=2 then
          begin
            if r(x)=366 then
              a:=a+29 else
              a:=a+28;
          end else
            a:=a+d[i];
        a:=a+z;
        q(a);
      end;
    end else
    begin
      a:=0;
      s1:=copy(s,1,4);
      val(s1,x);
      s1:=copy(s,6,2);
      val(s1,y);
      s1:=copy(s,9,2);
      val(s1,z);
      if x=1926 then
      begin
        if y=8 then
        begin
          q(17-z);
          continue;
        end;
        a:=17;
        for i:=y+1 to 7 do
          a:=a+d[i];
        a:=a+d[y]-z;
        q(a);
      end else
      begin
        a:=229;
        for i:=x+1 to 1925 do
          a:=a+r(i);
        for i:=12 downto y+1 do
          if i=2 then
          begin
            if r(x)=366 then
              a:=a+29 else
              a:=a+28;
          end else
            a:=a+d[i];
        a:=a+d[y]-z;
        q(a);
      end;
    end;
    if ((s>st) and (ss>st)) or ((s<st) and (ss<st)) then
    begin
      if pp-qq>0 then
        writeln(pp-qq) else
        writeln(qq-pp);
    end else
      writeln(pp+qq);
  end;
end.

{$IFDEF NORMAL}
  {$H-,I+,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF NORMAL}
{$IFDEF DEBUG}
  {$H-,I+,OBJECTCHECKS-,Q+,R+,S-}
{$ENDIF DEBUG}
{$IFDEF RELEASE}
  {$H-,I-,OBJECTCHECKS-,Q-,R-,S-}
{$ENDIF RELEASE}
const a:array[1..12]of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var x,y,i,j,all:longint;
    s:string;
Function f(s:string):longint;
var i,x,n,k,y,m,d:longint;
Begin
 n:=length(s);
 k:=0;y:=0;m:=0;d:=0;x:=0;
 for i:=1 to n do
  if(s[i]=':')then inc(k)
              else if(k=0)then y:=y*10+ord(s[i])-48
                          else if(k=1)then m:=m*10+ord(s[i])-48
                                      else if(k=2)then d:=d*10+ord(s[i])-48;
 for i:=1900 to y-1 do
  if((i mod 4=0)and(i mod 100<>0))or(i mod 400=0)then x:=x+all+1 else x:=x+all;
 for i:=1 to m-1 do
  begin
   x:=x+a[i];
   if(i=2)then if((y mod 4=0)and(y mod 100<>0))or(y mod 400=0) then x:=x+1;
  end;
 x:=x+d;
 exit(x);
End;
Begin
 for i:=1 to 12 do
  all:=all+a[i];
 readln(s);
 x:=f(s);
 readln(s);
 y:=f(s);
 writeln(abs(y-x));
End.

var
 dd,t,p1,p2,n,m,k,kol,ans,x,y,z:int64;
 sa,sb:string;
 s1,s2,s3:string;
 d:array[1..12] of int64;
 res1,res2,res:int64;
 i,j:longint;

function check(s:string):longint;
var
 s1,s2,s3,sa,sb:string;
 f1,f2,f3:integer;
 ans,c1,c2,c3,x,y,z,p1,p2:int64;
begin
 ans:=0;
 kol:=0;
 for i:=1 to length(s) do if s[i]=':' then
 begin
  inc(kol);
  if kol=1 then p1:=i;
  if kol=2 then p2:=i;
 end;
 s1:=copy(s,1,p1-1);
 s2:=copy(s,p1+1,p2-p1-1);
 s3:=copy(s,p2+1,length(s)-p2);
 val(s1,c1,f1);
 val(s2,c2,f2);
 val(s3,c3,f3);
 for i:=1900 to c1-1 do
 begin
  if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then dd:=366 else dd:=365;
  inc(ans,dd);

 end;
 for i:=1 to c2-1 do
 begin
  if (i=2)and(((c1 mod 4=0)and(c1 mod 100<>0))or(c1 mod 400=0)) then inc(ans,d[i]+1) else inc(ans,d[i]);
 end;
 inc(ans,c3);
 check:=ans;
end;

begin
 d[1]:=31; d[2]:=28; d[3]:=31; d[4]:=30; d[5]:=31;
 d[6]:=30; d[7]:=31; d[8]:=31; d[9]:=30; d[10]:=31; d[11]:=30;
 d[12]:=31;
{ assign(input,'input.txt');
 reset(input);
 assign(output,'output.txt');
 rewrite(output);    }
 res1:=0;
 res2:=0;
 res:=0;
 readln(sa);
 readln(sb);
 res1:=check(sa);
 res2:=check(sb);
 res:=abs(res2-res1);
 writeln(res);
end.

Program Calendar;
Const fi='';
      fo='';
      b:array[1..12] of byte=(31,28,31,30,31,30,31,31,30,31,30,31);
var f1,f2:text;
    a:string;
    nam,thang,ngay,songay2,songay1:longint;

Function tinhngay(x,y,z:longint):longint;
var i,v:longint;
begin
v:=0;
        for i:=1900 to x-1 do
            begin
            if ((i mod 4=0)  and (i mod 100<>0)) or (i mod 400=0) then
                v:=v+366
            else
                v:=v+365;
            end;
        for i:=1 to y-1 do
            begin
                v:=v+b[i];
            end;
if ((x mod 4=0)  and (x mod 100<>0)) or (x mod 400=0) then if y>2 then v:=v+1;
        v:=v+z;
        tinhngay:=v;
end;

Procedure nhap;
begin
        assign(f1,fi);
        assign(f2,fo);
        reset(F1);
        rewrite(f2);
        readln(f1,a);
        nam:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+(ord(a[4])-48);
        thang:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay:=(ord(a[9])-48)*10+(ord(a[10])-48);
        songay1:=tinhngay(nam,thang,ngay);
        readln(f1,a);
        nam:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+(ord(a[4])-48);
        thang:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay:=(ord(a[9])-48)*10+(ord(a[10])-48);
        songay2:=tinhngay(nam,thang,ngay);
end;

Procedure xuat;
begin
        writeln(f2,abs(songay1-songay2));
        close(f1);
        close(f2);
end;

begin
nhap;
xuat;
end.

Const
        thang:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
Type
        mat=array [1..1000000] of longint;
Var     n,res,y1,d1,m1,y2,d2,m2:longint;
        a,s:string;
        fi,fo:text;

Procedure Doc;
        Begin
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y1);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m1);
                Val(a,d1);
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y2);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m2);
                Val(a,d2);
        end;

Procedure Doicho(Var x,y:longint);
        Var tg:longint;
        Begin
                tg:=x;
                x:=y;
                y:=tg;
        end;

Function Nhuan(x:longint):boolean;
        Begin
                If ((x mod 4=0) and (x mod 100<>0)) or ( x mod 400=0) then
                 exit(true);
                exit(false);
        end;

Procedure Lam;
        Var i:longint;
        Begin
                 If y1>y2 then
                  Begin
                        Doicho(y1,y2);
                        Doicho(m1,m2);
                        Doicho(d1,d2);
                  end;
                 res:=0;
                 For i:=y1+1 to y2-1 do
                  If Nhuan(i) then
                   res:=res+366
                  else res:=res+365;
                 If y1=y2 then
                  Begin
                        If m1>m2 then
                         Begin
                                Doicho(m1,m2);
                                Doicho(d1,d2);
                         end;
                        For i:=m1+1 to m2-1 do res:=res+thang[i];
                        If (m1<=2) and (m2>2) and (Nhuan(y1)) then inc(res);
                        If m1<>m2 then
                          res:=res+thang[m1]-d1+d2
                        else res:=res+d2-d1;
                  end
                 else
                  Begin
                   For i:=m1+1 to 12 do res:=res+thang[i];
                 If Nhuan(y1) then
                   If m1<=2 then inc(res);
                 For i:= 1 to m2-1 do res:=res+thang[i];
                 If Nhuan(y2) then
                   If m2>2 then inc(res);
                 res:=res+thang[m1]-d1+d2;
                 end;
                Write(fo,res);
        end;

Procedure Inkq;
        Begin
        end;

        Begin
                Assign(fi,'');Reset(fi);
                Assign(fo,'');Rewrite(fo);
                        Doc;
                        Lam;
                        Inkq;
                Close(fo);Close(fi);
        end.

uses sysutils;
var n, i, j, y, yx, x: integer;
    m, mx, d, dx: byte;
    e: array [1..12] of byte;
    s: string;
    t: word;
function leap(y: integer): byte;
var e: byte;
begin
        e := 28;
        if y mod 4 = 0 then
                e := 29;
        if y mod 100 = 0 then
                e := 28;
        if y mod 400 = 0 then
                e := 29;
        leap := e;
end;
begin
        e[1] := 31;
        e[3] := 31;
        e[4] := 30;
        e[5] := 31;
        e[6] := 30;
        e[7] := 31;
        e[8] := 31;
        e[9] := 30;
        e[10] := 31;
        e[11] := 30;
        e[12] := 31;
        readln(s);
        y := strtoint(copy(s, 1, 4));
        m := strtoint(copy(s, 6, 2));
        d := strtoint(copy(s, 9, 2));
        readln(s);
        yx := strtoint(copy(s, 1, 4));
        mx := strtoint(copy(s, 6, 2));
        dx := strtoint(copy(s, 9, 2));
        t := 0;
        if yx < y then
        begin
                x := y;
                y := yx;
                yx := x;
                x := m;
                m := mx;
                mx := x;
                x := d;
                d := dx;
                dx := x;
        end
        else if yx = y then
        begin
                if mx < m then
                begin
                        x := m;
                        m := mx;
                        mx := x;
                        x := d;
                        d := dx;
                        dx := x;
                end
                else if (mx = m) and (dx < d) then
                begin
                        x := d;
                        d := dx;
                        dx := x;
                end;
        end;
        if y = yx then
        begin
                if m = mx then
                        t := dx - d
                else
                begin
                        e[2] := leap(y);
                        inc(t, e[m] - d + dx);
                        for i := m + 1 to mx - 1 do
                                inc(t, e[i]);
                end
        end
        else
        begin
                e[2] := leap(y);
                inc(t, e[m] - d);
                for i := m + 1 to 12 do
                        inc(t, e[i]);
                e[2] := leap(yx);
                inc(t, dx);
                for i := 1 to mx - 1 do
                        inc(t, e[i]);
                for i := y + 1 to yx - 1 do
                        inc(t, 337 + leap(i));
        end;
        writeln(t);
end.

var
  km:array[1..12]of longint;
  s:ansistring;
  yy,mm,dd,fy,fm,fd,tmp,ans:longint;

  procedure todate(s:ansistring;var yy,mm,dd:longint);
    begin
      val(s[1]+s[2]+s[3]+s[4],yy);
      val(s[6]+s[7],mm);
      val(s[9]+s[10],dd);
    end;

begin
  km[1]:=31;km[4]:=30;km[7]:=31;km[10]:=31;
  km[2]:=28;km[5]:=31;km[8]:=31;km[11]:=30;
  km[3]:=31;km[6]:=30;km[9]:=30;km[12]:=31;
  readln(s);
  todate(s,yy,mm,dd);
  readln(s);
  todate(s,fy,fm,fd);
  if (yy>fy)or(yy=fy)and(mm>fm)or(yy=fy)and(mm=fm)and(dd>fd)then begin
    tmp:=yy;yy:=fy;fy:=tmp;
    tmp:=mm;mm:=fm;fm:=tmp;
    tmp:=dd;dd:=fd;fd:=tmp;
  end;
  while (yy<>fy)or(mm<>fm)or(dd<>fd)do begin
    inc(ans);
    inc(dd);
    if (dd>km[mm])then begin
      dd:=1;inc(mm);
      if (mm>12)then begin
        mm:=1;
        inc(yy);
        if ((yy mod 4=0)and(yy mod 100<>0))or(yy mod 400=0)then km[2]:=29 else km[2]:=28;
      end;
    end;
  end;
  writeln(ans);
end.

program dates;

var s1,s2, tmp : string;
y1, y2, m1, m2, d1, d2, curd, curm, cury, i, cnt : longint;
a : array [1..12] of longint;
c : array [1..12] of longint;
b : array [1899..2040] of boolean;
begin
	Readln(s1);
	Readln(s2);

	tmp:=Copy(s1,1,pos(':',s1)-1);
	Delete(s1,1,pos(':',s1));
	val(tmp,y1);
	tmp:=Copy(s1,1,pos(':',s1)-1);
	Delete(s1,1,pos(':',s1));
	val(tmp,m1);
	val(s1,d1);

	tmp:=Copy(s2,1,pos(':',s2)-1);
	Delete(s2,1,pos(':',s2));
	val(tmp,y2);
	tmp:=Copy(s2,1,pos(':',s2)-1);
	Delete(s2,1,pos(':',s2));
	val(tmp,m2);
	val(s2,d2);

	if (y1>y2) or ( (y1=y2) and (m1>m2) ) or ( (y1=y2) and (m1=m2) and (d1>d2) ) then begin
		curd:=d1;
		d1:=d2;
		d2:=curd;

		curm:=m1;
		m1:=m2;
		m2:=curm;

		cury:=y1;
		y1:=y2;
		y2:=cury;
	end;

	curd:=d1;
	curm:=m1;
	cury:=y1;
	a[1]:=31;
	a[2]:=28;
	a[3]:=31;
	a[4]:=30;
	a[5]:=31;
	a[6]:=30;
	a[7]:=31;
	a[8]:=31;
	a[9]:=30;
	a[10]:=31;
	a[11]:=30;
	a[12]:=31;

	c[1]:=31;
	c[2]:=29;
	c[3]:=31;
	c[4]:=30;
	c[5]:=31;
	c[6]:=30;
	c[7]:=31;
	c[8]:=31;
	c[9]:=30;
	c[10]:=31;
	c[11]:=30;
	c[12]:=31;

	fillchar(b,sizeof(b),false);
	for i:=1899 to 2040 do begin
		if (i mod 100 = 0) and (i mod 400 = 0) then begin
			b[i]:=true;
		end else if (i mod 100 = 0) then begin
			b[i]:=false;
		end else if (i mod 4 = 0) then begin
			b[i]:=true;
		end;
	end;

	cnt:=0;
	while (curd<>d2) or (curm<>m2) or (cury<>y2) do begin
		inc(cnt);
		if b[cury] then begin
			inc(curd);
			if curd>c[curm] then begin
				inc(curm);
				curd:=1;
				if curm>12 then begin
					curm:=1;
					inc(cury);
				end;
			end;
		end else begin
			inc(curd);
			if curd>a[curm] then begin
				inc(curm);
				curd:=1;
				if curm>12 then begin
					curm:=1;
					inc(cury);
				end;
			end;
		end;
	end;
	Writeln(cnt);
end.

var
  u,vv : array [0..12] of longint;
  s1,s2 : ansistring;
  y,m,d,ty,tm,td,i,j : longint;
  ans : longint;
  code : integer;
  procedure swap;
  var z : longint;
  begin
    z:=y; y:=ty; ty:=z;
    z:=m; m:=tm; tm:=z;
    z:=d; d:=td; td:=z;
  end;
  function V(x : longint) : boolean;
  begin
    if ((x mod 400)=0) then exit(true);
    if ((x mod 4)=0) and ((x mod 100)>0) then exit(true);
    exit(false);
  end;
  procedure build;
  var ny,nm,nd : longint;
  begin
    ny:=y; nm:=m; nd:=d;
    if V(y) then
    begin
      inc(nd);
      if nd>vv[nm] then
      begin
        inc(nm);
        nd:=1;
      end;
      if nm>12 then
      begin
        inc(ny);
        nm:=1;
        nd:=1;
      end;
    end else
    begin
      inc(nd);
      if nd>u[nm] then
      begin
        inc(nm);
        nd:=1;
      end;
      if nm>12 then
      begin
        inc(ny);
        nm:=1;
        nd:=1;
      end;
    end;
    y:=ny; m:=nm; d:=nd;
  end;
begin
  u[1]:=31;u[2]:=28;u[3]:=31;u[4]:=30;u[5]:=31;u[6]:=30;u[7]:=31;u[8]:=31;u[9]:=30;u[10]:=31;u[11]:=30;u[12]:=31;
  for i:=1 to 12 do vv[i]:=u[i];
  vv[2]:=29;
  readln(s1);
  readln(s2);
  val(copy(s1,1,4),y,code);
  val(copy(s1,6,2),m,code);
  val(copy(s1,9,2),d,code);
  val(copy(s2,1,4),ty,code);
  val(copy(s2,6,2),tm,code);
  val(copy(s2,9,2),td,code);
  if (y>ty) or ((y=ty) and (m>tm)) or
    ((y=ty) and (m=tm) and (d>td)) then swap;
  while not ((y=ty) and (m=tm) and (d=td)) do
  begin
    build;
    inc(ans);
  end;
  writeln(ans);
end.

var  ch,ch1:string;
 a1,a2,a3,b1,b2,b3,k,k1,s,s1,s3,s2,i:longint;
 code,y:integer;
 c:array[1..12]of integer;
 c1:array[1..12]of integer;

       function runnian(a:integer):boolean;
begin
      if (a mod 4=0) and (a mod 100<>0) then exit(true)
       else if a mod 400=0 then exit(true);
       exit(false);
      end;
begin
     readln(ch);
     readln(ch1);
     s:=0; s1:=0; s3:=0; s2:=0;
    delete(ch,5,1);
    delete(ch,7,1);
    delete(ch1,5,1);
    delete(ch1,7,1);
  val(ch,k,code);
  val(ch1,k1,code);
  a1:=k div 10000;
  b1:=k1 div 10000;
  a2:=k div 100-a1*100;
  b2:=k1 div 100-b1*100;
  a3:=k-(a1*10000+a2*100);
  b3:=k1-(b1*10000+b2*100);
  c[1]:=31; c[2]:=28; c[3]:=31; c[4]:=30; c[5]:=31; c[6]:=30; c[7]:=31;c[8]:=31;c[9]:=30;c[10]:=31;c[11]:=30;c[12]:=31;
c1[1]:=31; c1[2]:=29; c1[3]:=31; c1[4]:=30; c1[5]:=31; c1[6]:=30; c1[7]:=31;c1[8]:=31;c1[9]:=30;c1[10]:=31;c1[11]:=30;c1[12]:=31;
 if a1>b1 then
  begin

   if runnian(a1) then
   for i:=1 to a2-1 do
   begin
    s:=s+c1[i];
    end
    else for i:=1 to a2-1 do
    begin s:=s+c[i];
    end; s:=s+a3;

  if runnian(b1) then
      for i:=1 to b2-1 do begin
      s1:=s1+c1[i];  end else  for i:=1 to b2-1 do
      begin s1:=s1+c[i];   end;   s1:=s1+b3;
        for i:=b1+1 to a1-1  do
         begin
          if runnian(i) then s3:=s3+366 else s3:=s3+365;
         end;
       if runnian(b1) then s2:=366-s1+s+s3 else s2:=365-s1+s+s3;
   end;
      if a1<b1 then
  begin

   if runnian(b1) then
   for i:=1 to b2-1 do
   begin
    s:=s+c1[i];
    end
    else for i:=1 to b2-1 do
    begin s:=s+c[i];
    end; s:=s+b3;

  if runnian(a1) then
      for i:=1 to a2-1 do begin
      s1:=s1+c1[i];  end else  for i:=1 to a2-1 do
      begin s1:=s1+c[i];   end;   s1:=s1+a3;
        for i:=a1+1 to b1-1  do
         begin
          if runnian(i) then s3:=s3+366 else s3:=s3+365;
         end;
       if runnian(a1) then s2:=366-s1+s+s3 else s2:=365-s1+s+s3;
    end;
    if a1=b1 then
     begin
      if runnian(a1) then
       begin
       for i:=1 to a2-1 do
        begin
        s:=s+c1[i];
        end;
        for i:=1 to b2-1  do
         begin
         s1:=s1+c1[i];
         end;
        s:=s+a3; s1:=s1+b3
        end;
           s2:=abs(s1-s);
          end;
     if a1=b1 then
     begin
      if not runnian(a1) then
       begin
       for i:=1 to a2-1 do
        begin
        s:=s+c[i];
        end;
        for i:=1 to b2-1  do
         begin
         s1:=s1+c[i];
         end;
        s:=s+a3; s1:=s1+b3
        end;
           s2:=abs(s1-s);
          end;

       writeln(s2);
       readln;

end.

var prim,doi,an_1,luna_1,zi_1,an_2,luna_2,zi_2:string;
    an1,luna1,zi1,an2,luna2,zi2,cod,i:integer;
    raspuns,q,w,z,s:longint;
    an:1900..2038;
    luna:1..12;
    zi:1..31;
begin
    readln(prim);
    readln(doi);
    an_1:=copy(prim,1,4);
    luna_1:=copy(prim,6,2);
    zi_1:=copy(prim,9,2);
    an_2:=copy(doi,1,4);
    luna_2:=copy(doi,6,2);
    zi_2:=copy(doi,9,2);
    val(an_1,an1,cod);
    val(an_2,an2,cod);
    val(luna_1,luna1,cod);
    val(luna_2,luna2,cod);
    val(zi_1,zi1,cod);
    val(zi_2,zi2,cod);
    for i:=1900 to an1 do
    begin
    if (i mod 4=0)and(i mod 100<>0)and(i mod 400<>0)then q:=q+366
    else
    if (i mod 100=0)and(i mod 400=0)then q:=q+366
    else q:=q+365;
    end;
    if (an1 mod 4=0)and(an1 mod 100<>0)and(an1 mod 400<>0)then  z:=29
                   else
                   if (an1 mod 100=0)and(an1 mod 400=0)then  z:=29
                   else  z:=28;
    if luna1=1 then s:=s+zi1;
    if luna1=2 then s:=s+31+zi1;
    if luna1=3 then s:=s+31+zi1+z;
    if luna1=4 then s:=s+62+zi1+z;
    if luna1=5 then s:=s+92+zi1+z;
    if luna1=6 then s:=s+123+zi1+z;
    if luna1=7 then s:=s+153+zi1+z;
    if luna1=8 then s:=s+184+zi1+z;
    if luna1=9 then s:=s+215+zi1+z;
    if luna1=10 then s:=s+245+zi1+z;
    if luna1=11 then s:=s+276+zi1+z;
    if luna1=12 then s:=s+306+zi1+z;
    q:=q+s;
    if an1=1900 then q:=s+365;
    if an1=2038 then q:=q-365;
    s:=0;z:=0;
    for i:=1900 to an2 do
    begin
    if (i mod 4=0)and(i mod 100<>0)and(i mod 400<>0)then w:=w+366
    else
    if (i mod 100=0)and(i mod 400=0)then w:=w+366
    else w:=w+365;
    end;
    if (an2 mod 4=0)and(an2 mod 100<>0)and(an2 mod 400<>0)then  z:=29
                   else
                   if (an2 mod 100=0)and(an2 mod 400=0)then  z:=29
                   else z:=28;
    if luna2=1 then s:=s+zi2;
    if luna2=2 then s:=s+31+zi2;
    if luna2=3 then s:=s+31+zi2+z;
    if luna2=4 then s:=s+62+zi2+z;
    if luna2=5 then s:=s+92+zi2+z;
    if luna2=6 then s:=s+123+zi2+z;
    if luna2=7 then s:=s+153+zi2+z;
    if luna2=8 then s:=s+184+zi2+z;
    if luna2=9 then s:=s+215+zi2+z;
    if luna2=10 then s:=s+245+zi2+z;
    if luna2=11 then s:=s+276+zi2+z;
    if luna2=12 then s:=s+306+zi2+z;
    w:=w+s;
    if an2=1900 then w:=s+365;
    if (an1 mod 4=0)and(an1 mod 100<>0)and(an1 mod 400<>0)then q:=q-366
    else
    if (an1 mod 100=0)and(an1 mod 400=0)then q:=q-366
    else q:=q-365;
    if (an2 mod 4=0)and(an2 mod 100<>0)and(an2 mod 400<>0)then w:=w-366
    else
    if (an2 mod 100=0)and(an2 mod 400=0)then w:=w-366
    else w:=w-365;
    raspuns:=abs(q-w);
    writeln(Raspuns);
end.

var     y1, y2, m1, m2, d1, d2, year : integer;
        kq, k1, k2 : longint;
        c1, c2 : char;
        i, j : integer;
        f2,f1 : text;
        s1, s2 : string;
const   day : array[1..12] of integer
        = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function songay(x : integer) : integer;
        begin
                if x mod 400 = 0 then exit(366);
                if x mod 100 = 0 then exit(365);
                if x mod 4 = 0 then exit(366);
                exit(365);
        end;
function kt(x : integer) : boolean;
        begin
                if x mod 400 = 0 then exit(true);
                if x mod 100 = 0 then exit(false);
                if x mod 4 = 0 then exit(true);
                exit(false);
        end;
begin
        assign(f1, ''); reset(f1);
        readln(f1,s1);
        readln(f1,s2);
        close(f1);
        for i := 1 to length(s1) do
                begin
                if s1[i] = ':' then s1[i] := ' ';
                if s2[i] = ':' then s2[i] := ' ';
                end;
        assign(f2, 'test.txt'); rewrite(f2);
        writeln(f2, s1);
        writeln(f2, s2);
        close(f2);
        reset(f2);
        readln(f2, y1, m1, d1);
        readln(f2, y2, m2, d2);
        close(f2);
        if y1 < y2 then year := y1 else year := y2;
        {---}
        k1 := d1;
        if kt(y1) then
                begin
                  if m1 > 2 then inc(k1);
                end;
        for i := 1 to m1 - 1 do
                k1 := k1 + day[i];
        for i := year to y1 - 1 do
                k1 := k1 + songay(i);
        // -----
        k2 := d2;
        if kt(y2) then
                begin
                  if m2 > 2 then inc(k2);
                end;
        for i := 1 to m2 - 1 do
                k2  := k2 + day[i];
        for i := year to y2 - 1 do
                k2 := k2 + songay(i);
        writeln(abs(k1-k2));
end.

program b;
uses sysutils, dateutils;
var
    y, m, d: word;
    d1, d2: TDateTime;
function readInt: word;
    var
        c: char;
        s: string;
        res, v: word;
    begin
        s := '';
        repeat read(c) until (c in ['0'..'9']);
        s := s + c;
        repeat
            read(c);
            if (c in ['0'..'9']) then s := s + c else break;
        until false;
        val(s, res, v);
        exit(res);
    end;
begin
    y := readInt; m := readInt; d := readInt;
    d1 := encodeDate(y, m, d);
    y := readInt; m := readInt; d := readInt;
    d2 := encodeDate(y, m, d);
    writeln(daysBetween(d1, d2));
end.

const
      p:array[1..12] of longint=(31,100,31,30,31,30,31,31,30,31,30,31);
var
    s1,s2:string;
    x1,y1,z1,x2,y2,z2,ans:longint;

function d(s:string;l,r:longint):longint;
var
    i,x:longint;
begin
  x:=0;
  for i:=l to r do
    x:=x*10+ord(s[i])-48;
  exit(x);
end;

function run(x:longint):boolean;
begin
  if x mod 400=0 then exit(true);
  if x mod 100=0 then exit(false);
  if x mod 4=0 then exit(true) else exit(false);
end;

procedure next(var x,y,z:longint);
begin
  inc(z);
  if z>p[y] then begin z:=1;inc(y);end;
  if y=2 then
    begin
      if (run(x)) and (z=30) then
        begin
          z:=1;inc(y);
        end;
      if (run(x)=false) and (z=29) then
        begin
          z:=1;inc(y);
        end;
    end;
  if y=13 then begin inc(x);y:=1;end;
end;

procedure swap(var x,y:longint);
var
    temp:longint;
begin
  temp:=x;x:=y;y:=temp;
end;

begin {main}
  readln(s1);
  readln(s2);
  x1:=d(s1,1,4);y1:=d(s1,6,7);z1:=d(s1,9,10);
  x2:=d(s2,1,4);y2:=d(s2,6,7);z2:=d(s2,9,10);
  if (x1>x2) or ((x1=x2) and (y1>y2)) or ((x1=x2) and (y1=y2) and (z1>z2)) then
    begin
      swap(x1,x2);swap(y1,y2);swap(z1,z2);
    end;
  ans:=0;
  while (x1<>x2) or (y1<>y2) or (z1<>z2) do
    begin
      next(x1,y1,z1);
      inc(ans);
    end;
  writeln(ans);
end.

const   fi = '';
        fo = '';
var     f,g:text;
        s1,s2:string;

procedure openfile;
begin
        assign(f,fi);reset(f);
        assign(g,fo);rewrite(g);
end;
procedure readfile;
begin
        readln(f,s1);
        readln(f,s2);
end;
function sn(i:integer;k:boolean):integer;
begin
        case i of
                1,3,5,7,8,10,12:sn:=31;
                4,6,9,11:sn:=30;
                2:if k then sn:=29
                else sn:=28;
        end;
end;
function tinh(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:= b+1 to 12 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+sn(b,kt)-c;
        tinh:=t;

end;
function tinh1(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:=1 to b-1 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+c;
        tinh1:=t;
end;
procedure swap(var a,b:longint);
var     tg:longint;
begin
        tg:=a;
        a:=b;
        b:=tg;
end;
procedure process;
var     t,b,dem,i,vt,k,a1,b1,c1,a2,b2,c2:longint;
        kq:int64;
        kt:boolean;
begin
        kq:=0;
        k:=pos(':',s1);
        val(copy(s1,1,k-1),a1);
        delete(s1,1,k);
        k:=pos(':',s1);
        val(copy(s1,1,k-1),b1);
        delete(s1,1,k);
        val(s1,c1);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),a2);
        delete(s2,1,k);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),b2);
        delete(s2,1,k);
        val(s2,c2);
        if a1=a2 then
                begin
                        if a1 mod 4=0 then
                                begin
                                        kt:=true;
                                        if (a1 mod 100=0) and (a1  mod 400=0) then kt:=false;
                                end
                        else kt:=false;
                        if b1>b2 then
                                begin
                                        swap(b1,b2);
                                        swap(c1,c2);
                                end;
                        for i:=b1+1 to b2-1 do
                                kq:=kq+sn(i,kt);
                        if b1=b2 then
                                begin
                                        kq:=abs(c1-c2);
                                end
                        else kq:=kq+sn(b1,kt)-c1+c2;
                end
        else
        begin
        if a1>a2 then
                begin
                        swap(a1,a2);
                        swap(b1,b2);
                        swap(c1,c2);
                end;
        for i:=a1+1 to a2-1 do
                if (i mod 4=0) then
                        begin
                        kq:=kq+366;
                        if (i mod 100=0) and (i mod 400<>0) then kq:=kq-1;
                        end
                else kq:=kq+365;
        kq:=kq+tinh(a1,b1,c1)+tinh1(a2,b2,c2);
        end;
        writeln(g,kq);
end;
procedure closefile;
begin
        close(f);
        close(g);
end;
begin
        openfile;
        readfile;
        process;
        closefile;
end.

type int=longint;
const mf:array[1..12]of int=(31,28,31,30,31,30,31,31,30,31,30,31);
var
  i,j,k,m,n,ans:longint;
  a,b,c,aa,bb,cc:int;
  ch:char;
  f:array[1..12]of int;
function yes(a:int):boolean;
begin
  if(a mod 4=0)then
  begin
    if (a mod 100=0)and(a mod 400<>0)then exit(false);
    exit(true);
    end;
  exit(false);
end;
procedure te();
var i,j:int;
begin
  if yes(a) then inc(f[2]);
  if b=bb then
  begin
    for i:=c+1 to cc do inc(ans);
    writeln(ans);
    close(input);close(output);halt;
  end;
  for i:=b+1 to bb-1 do inc(ans,f[i]);
  inc(ans,f[b]-c);inc(ans,cc);
  writeln(ans);
  close(input);close(output);halt;
end;

begin

  for i:=1 to 12 do f[i]:=mf[i];
  for i:=1 to 4 do begin
  read(ch);a:=a*10+ord(ch)-48;end;
  read(ch);
  for i:=1 to 2 do begin
  read(ch);b:=b*10+ord(ch)-48;end;
  read(ch);
  for i:=1 to 2 do begin
  read(ch);c:=c*10+ord(ch)-48;end;  readln;
   for i:=1 to 4 do begin
  read(ch);aa:=aa*10+ord(ch)-48;end;
  read(ch);
  for i:=1 to 2 do begin
  read(ch);bb:=bb*10+ord(ch)-48;end;
  read(ch);
  for i:=1 to 2 do begin
  read(ch);cc:=cc*10+ord(ch)-48;end;
  if (a>aa)or(a=aa)and(b>bb)or(a=aa)and(b=bb)and(c>cc)then
  begin
    k:=a;a:=aa;aa:=k;
    k:=b;b:=bb;bb:=k;
    k:=c;c:=cc;cc:=k;
  end;
  for i:=a+1 to aa-1 do
  begin
    inc(ans,365);
    if yes(i) then inc(ans);
  end;
  if aa=a then te();
  if yes(a) then inc(f[2]);
  for i:=b+1 to 12 do inc(ans,f[i]);
  inc(ans,f[b]-c);
  f[2]:=mf[2];
  if yes(aa) then inc(f[2]);
  for i:=1 to bb-1 do inc(ans,f[i]);
  inc(ans,cc);
  writeln(ans);
  close(input);close(output);
end.

Program B183;
Var
  con:Array[1..12] Of Longint=(31,28,31,30,31,30,31,31,30,31,30,31);
  sum:Array[0..12] OF Longint;
  s1,s2,nian,yue,ri:String;
  nian1,nian2,yue1,yue2,ri1,ri2,ans,i,n:Longint;
  flag:Boolean;
Begin
  For i:=1 To 12 Do sum[i]:=sum[i-1]+con[i];
  Readln(s1);
  Readln(s2);
  If s1>s2 Then Begin
    nian:=s1;
    s1:=s2;
    s2:=nian;
  End;
  nian:=Copy(s1,1,4);
  Val(nian,nian1);
  yue:=Copy(s1,6,2);
  Val(yue,yue1);
  ri:=Copy(s1,9,2);
  Val(ri,ri1);
  nian:=Copy(s2,1,4);
  Val(nian,nian2);
  yue:=Copy(s2,6,2);
  Val(yue,yue2);
  ri:=Copy(s2,9,2);
  Val(ri,ri2);
  flag:=True;
  If (nian1 Mod 100=0) Then Begin
    If nian1 Mod 400<>0 Then flag:=False;
  End Else If nian1 Mod 4<>0 Then flag:=FAlse;
  ans:=ans+sum[12]-sum[yue1];
  ans:=ans+con[yue1]-ri1;
  If (yue1<=2)And(flag) Then Inc(ans);
  For i:=nian1+1 To nian2-1 Do Begin
    ans:=ans+sum[12];
    flag:=True;
    If (i Mod 100=0) Then Begin
      If i Mod 400<>0 Then flag:=False;
    End Else If i Mod 4<>0 Then flag:=False;
    If flag Then Inc(ans);
  End;
  ans:=ans+sum[yue2-1]+ri2;
  flag:=True;
  If (nian2 Mod 100=0) Then Begin
    If nian2 Mod 400<>0 Then flag:=FAlse;
  End Else If nian2 Mod 4<>0 Then flag:=False;
  If (yue2>=3)And(flag) Then inc(ans);
  If nian1=nian2 Then Begin
    ans:=ans-365;
    If flag Then ans:=ans-1;
  End;
  Writeln(ans);
End.

const a:array[1..12]of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var x,y,i,j,all:longint;
    s:string;
function f(s:string):longint;
var i,x,n,k,y,m,d:longint;
 begin
  n:=length(s);
  k:=0;y:=0;m:=0;d:=0;x:=0;
  for i:=1 to n do
   if(s[i]=':')then inc(k)
   else
   if(k=0)then y:=y*10+ord(s[i])-48
   else
   if(k=1)then m:=m*10+ord(s[i])-48
   else
   if(k=2)then d:=d*10+ord(s[i])-48;
   for i:=1900 to y-1 do
    if((i mod 4=0)and(i mod 100<>0))or(i mod 400=0)then x:=x+all+1 else x:=x+all;
   for i:=1 to m-1 do
    begin
     x:=x+a[i];
     if(i=2)then if((y mod 4=0)and(y mod 100<>0))or(y mod 400=0) then x:=x+1;
    end;
   x:=x+d;
   exit(x);
  end;
 begin
  for i:=1 to 12 do
   all:=all+a[i];
  readln(s);
  x:=f(s);
  readln(s);
  y:=f(s);
  writeln(abs(y-x));
 end.

var s:ansistring;a,b,c,a1,b1,c1,i,d:longint;m:array[0..1000]of longint;
Procedure data(s:ansistring;var a,b,c:longint);
var f:integer;
begin
      val(Copy(s,1,pos(':',s)-1),c,f);
      delete(s,1,pos(':',s));
      val(Copy(s,1,pos(':',s)-1),b,f);
      delete(s,1,pos(':',s));
      val(s,a,f);
end;
procedure swap;
var x:longint;
begin
        x:=c;
        c:=c1;
        c1:=x;
        x:=b;
        b:=b1;
        b1:=x;
        x:=a;
        a:=a1;
        a1:=x;
end;
Begin
        readln(s);
        m[1]:=31;
        m[3]:=31;
        m[4]:=30;
        m[5]:=31;
        m[6]:=30;
        m[7]:=31;
        m[8]:=31;
        m[9]:=30;
        m[10]:=31;
        m[11]:=30;
        m[12]:=31;
        data(s,a,b,c);
        readln(s);
        data(s,a1,b1,c1);
        if c>c1 then
        begin
                swap;
        end
        else if c=c1
        then
        begin
                if b>b1 then
                swap
                else if (b=b1) and(a>a1) then swap;
        end;
        if (c mod 400=0)or((c mod 4=0)and(c mod 100>0))then m[2]:=29
        else m[2]:=28;
        for i:=c to c1-1 do
        if (i mod 400=0)or((i mod 4=0)and(i mod 100>0))then d:=d+366
        else d:=d+365;
        for i:=1 to b-1 do
        d:=d-m[i];
        if (c1 mod 400=0)or((c1 mod 4=0)and(c1 mod 100>0))then m[2]:=29
        else m[2]:=28;
        for i:=1 to b1-1 do
        d:=d+m[i];
        d:=d-a+a1;
        writeln(d);
End.

program uio;
const month:array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
 var  s1,s2:string;
      y1,m1,d1,y2,m2,d2,kol,i:longint;

procedure pro(s:string; var y,m,d:longint);
 var code:longint;
     ss:string;

begin

 ss:=s[1]+s[2]+s[3]+s[4];
 val(ss,y,code);

 ss:='';
 if s[6]='0' then ss:=ss+s[7]
             else ss:=ss+s[6]+s[7];
 val(ss,m,code);

 ss:='';
 if s[9]='0' then ss:=ss+s[10]
             else ss:=ss+s[9]+s[10];
 val(ss,d,code);

end;

function vis(x:longint):boolean;
begin

 if (x mod 400) = 0 then exit(true);
 if (x mod 4 = 0)and(x mod 100<>0) then exit(true);
 exit(false);

end;

procedure rev;
 var cc:longint;

begin

 cc:=y1; y1:=y2; y2:=cc;
 cc:=m1; m1:=m2; m2:=cc;
 cc:=d1; d1:=d2; d2:=cc;

end;

BEGIN

 readln(s1); readln(s2);
 pro(s1,y1,m1,d1); pro(s2,y2,m2,d2);
 if (y1=y2)and(m1=m2)and(d1=d2) then begin writeln(0); halt; end;
 kol:=0;
 if y1>y2 then rev
  else if (y1=y2)and(m1>m2) then rev
   else if (y1=y2)and(m1=m2)and(d1>d2) then rev;

  while (y1<=y2) do
   begin
    if vis(y1) then month[2]:=29;
     while true do
      begin
       inc(d1); inc(kol); if d1>month[m1] then begin inc(m1); d1:=1; end;
       if m1>12 then begin m1:=1; break; end;
       if (y1=y2)and(m1=m2)and(d1=d2) then begin writeln(kol); halt; end;
      end;
     inc(y1); month[2]:=28;
   end;

 writeln(kol);

END.

const fi = '';
      fo = '';
      dom: array [1..12] of longint = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var day1, month1, year1: longint;
    day2, month2, year2, count: longint;

procedure SRead(var day, month, year: longint);
var s, t: string;
    code: longint;
begin
 readln(s);
 val(copy(s, 1, pos(':', s)-1), year, code);
 delete(s, 1, pos(':', s));
 val(copy(s, 1, pos(':', s)-1), month, code);
 delete(s, 1, pos(':', s));
 val(s, day, code);
end;

procedure Swap(var a, b: longint);
var t: longint;
begin
 t:=a; a:=b; b:=t;
end;

procedure Work;
begin
 if (year1 > year2) or ((year1 = year2) and (month1 > month2))
 or ((year1 = year2) and (month1 = month2) and (day1 > day2)) then
  begin
   Swap(year1, year2);
   Swap(month1, month2);
   Swap(day1, day2);
  end;

 while (year1 <> year2) or (month1 <> month2) or (day1 <> day2) do
  begin
   inc(day1);
   if (month1 = 2) and (year1 mod 4 = 0) and ((year1 mod 100 <> 0) or (year1 mod 400 = 0))
   then
    begin
     if day1 > 29 then
      begin
       day1:=1;
       inc(month1)
      end;
    end
   else if (day1 > dom[month1]) then
    begin
     day1:=1;
     inc(month1);
    end;

   if month1 > 12 then
    begin
     month1:=1;
     inc(year1);
    end;
   inc(count);
  end;
 writeln(count);
end;

begin
 assign(input, fi); reset(input);
 assign(output, fo); rewrite(output);

 SRead(day1, month1, year1);
 SRead(day2, month2, year2);
 Work;

 close(input); close(output);
end.

var s1, s2:string;
    y1, y2, d1, d2, m1, m2, i, m:longint;
    a:array[1..15] of longint;
    ans:int64;

procedure data;
var i:longint;
 begin

 for i:=1 to 4 do
  begin
  y1:=y1*10+ord(s1[i])-48;
  y2:=y2*10+ord(s2[i])-48;
  end;
 for i:=6 to 7 do
  begin
  m1:=m1*10+ord(s1[i])-48;
  m2:=m2*10+ord(s2[i])-48;
  end;
 for i:=9 to 10 do
  begin
  d1:=d1*10+ord(s1[i])-48;
  d2:=d2*10+ord(s2[i])-48;
  end;
 end;

procedure con;
 begin
 a[1]:=31;
 a[2]:=28;
 a[3]:=31;
 a[4]:=30;
 a[5]:=31;
 a[6]:=30;
 a[7]:=31;
 a[8]:=31;
 a[9]:=30;
 a[10]:=31;
 a[11]:=30;
 a[12]:=31;
 end;

function vis(x:longint):boolean;
var bool:boolean;
 begin
 if (x mod 4=0)and(x mod 100<>0)
   then bool:=true
   else if (x mod 400=0) then bool:=true
                         else bool:=false;
 vis:=bool;
 end;

procedure sswap;
var cc:longint;
 begin
 cc:=y1; y1:=y2; y2:=cc;
 cc:=m1; m1:=m2; m2:=cc;
 cc:=d1; d1:=d2; d2:=cc;
 end;

procedure perenos;
 begin
 if y1>y2 then sswap
          else begin
               if (y1=y2)and(m1>m2) then sswap
                        else if (y1=y2)and(m1=m2)and(d1>d2)
                              then sswap;
               end;
 end;

begin

//assign(input, 'input.txt'); reset(input);
//assign(output, 'output.txt'); rewrite(output);

readln(s1);
readln(s2);

con;
data;
perenos;

if y1=y2 then begin

              if vis(y1)
                then begin

                     if m1=m2
                       then begin

                            ans:=d2-d1-1;

                            end
                       else begin

                            ans:=a[m1]-d1;
                            if m1=2 then inc(ans);
                            ans:=ans+d2-1;
                             for m:=m1+1 to m2-1 do
                              begin
                              ans:=ans+a[m];
                              if m=2 then ans:=ans+1;
                              end;

                            end;

                     end
                else begin

                     if m1=m2
                       then begin

                            ans:=d2-d1-1;

                            end
                       else begin

                            ans:=a[m1]-d1;
                            ans:=ans+d2-1;
                             for m:=m1+1 to m2-1 do
                              begin
                              ans:=ans+a[m];
                              end;

                            end;

                     end;

              end
         else begin

              ans:=a[m1]-d1;
              for i:=m1+1 to 12 do
               begin
               if (i=2)and(vis(y1)) then inc(ans);
               ans:=ans+a[i];
               end;

              for i:=y1+1 to y2-1 do
               if vis(i) then ans:=ans+366
                         else ans:=ans+365;

              for i:=1 to m2-1 do
               begin
               if (vis(y2))and(i=2) then ans:=ans+1;
               ans:=ans+a[i];
               end;

              ans:=ans+d2-1;

              end;

writeln(ans+1);

//close(input); close(output);

end.

var y1,y2,dem:word; m1,d1,m2,d2,i:byte; s,p,tg:string[10];
function day(month:byte;year:word):byte;
begin
        case month of
        4,6,9,11: day:=30;
        2: if (year mod 400=0) or ((year mod 4=0) and (year mod 100>0)) then day:=29
        else day:=28
        else day:=31
        end
end;
begin
        readln(s);
        readln(p);
        if s>p then
        begin
                tg:=s; s:=p; p:=tg
        end;
        val(s[1]+s[2]+s[3]+s[4],y1,i);
        val(s[6]+s[7],m1,i);
        val(s[9]+s[10],d1,i);
        val(p[1]+p[2]+p[3]+p[4],y2,i);
        val(p[6]+p[7],m2,i);
        val(p[9]+p[10],d2,i);
        dem:=0;
        while (y1<y2) or (m1<m2) or (d1<d2) do
        begin
                if d1=day(m1,y1) then
                begin
                        d1:=1;
                        if m1=12 then
                        begin
                                m1:=1;
                                inc(y1)
                        end
                        else inc(m1)
                end
                else inc(d1);
                inc(dem)
        end;
        write(dem)
end.

const months:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var
    s1,s2:string; k1,k2,dd1,dd2,mm1,mm2,yy1,yy2,code,dd,mm,yy,k:longint;

function high(year:longint):boolean;
begin
  if (year mod 4<>0) then high:=false else
  if (year mod 100<>0) then high:=true else
  if (year mod 400=0)  then high:=true else high:=false;
end;

begin

  readln(s1); val(copy(s1,9,2),dd1,code); val(copy(s1,6,2),mm1,code); val(copy(s1,1,4),yy1,code);
  readln(s2); val(copy(s2,9,2),dd2,code); val(copy(s2,6,2),mm2,code); val(copy(s2,1,4),yy2,code);
  dd:=1; mm:=1; yy:=1900; k:=1; k1:=1; k2:=1;
  while not((dd=1)and(mm=1)and(yy=2040)) do
    begin
      inc(dd); inc(k);
      if (dd>months[mm]) then
        begin
          if (dd=29) and (mm=2) and (high(yy)=true) then else
            begin
              dd:=1; inc(mm);
              if mm=13 then begin inc(yy); mm:=1; end;
            end;
        end;
      if (dd1=dd) and (mm1=mm) and (yy1=yy) then k1:=k;
      if (dd2=dd) and (mm2=mm) and (yy2=yy) then k2:=k;
    end;
  writeln(abs(k1-k2));

end.

Const   a : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);

Var     y1, m1, d1, y2, i, m2, d2, dd, code : longint;
        date : int64;
        s1, s2 : string;

Procedure change(m,d:longint);
 Var    month, day : longint;
 Begin
        dd := 0;
        for i:=1 to m-1 do
                dd := dd+a[i];
        dd := dd+d;
 End;

Procedure swap(var x, y : longint);
 Var    tmp : longint;
 Begin
        tmp := x;
        x := y;
        y := tmp;
 End;

Begin
        readln(s1);
        readln(s2);
        val(copy(s1,1,4),y1,code);
        val(copy(s1,6,2),m1,code);
        val(copy(s1,9,2),d1,code);
        /////////
        val(copy(s2,1,4),y2,code);
        val(copy(s2,6,2),m2,code);
        val(copy(s2,9,2),d2,code);
        /////////
        if (y1 > y2) or ((y1 = y2) and (m1 > m2)) or ((y1 = y2) and (m1 = m2) and (d1 > d2)) then begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i:=y1 to y2-1 do begin
                if (i mod 400 = 0) and (i mod 1000 = 0) then begin
                        date := date+366;
                        continue;
                end;
                if i mod 100 = 0 then begin
                        date := date+365;
                        continue;
                end;
                if i mod 4 = 0 then date := date+366
                else date := date+365;
        end;
        change(m1,d1);
        if (((y1 mod 400 = 0) and (y1 mod 1000 = 0)) or ((y1 mod 100 <> 0) and (y1 mod 4 = 0))) and (m1 > 2) then
                dd := dd+1;
        date := date-dd;
        dd := 0;
        change(m2,d2);
        if (((y2 mod 400 = 0) and (y2 mod 1000 = 0)) or ((y2 mod 100 <> 0) and (y2 mod 4 = 0))) and (m2 > 2) then
                dd := dd+1;
        date := date+dd;
        writeln(date);
End.

const a:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var s,s1:string;
x,x1,y1,y,z,z1,ans,i,c,f:longint;
Begin
       // assign(input, 'input.txt'); reset(input);
        //assign(output, 'output.txt'); rewrite(output);
     readln(s);
     readln(s1);
     if s=s1 then begin writeln(0); halt; end;
     for i:=1 to 4 do
     begin
          val(s[i],c,f);
          x:=x*10+c;
          val(s1[i],c,f);
          x1:=x1*10+c;
     end;
     for i:=6 to 7 do
     begin
          val(s[i],c,f);
          y:=y*10+c;
          val(s1[i],c,f);
          y1:=y1*10+c;
     end;
     for i:=9 to 10 do
     begin
          val(s[i],c,f);
          z:=z*10+c;
          val(s1[i],c,f);
          z1:=z1*10+c;
     end;
    // writeln(x,' ',x1,' ',z,' ',z1,' ',y,' ',y1);
     if (x>x1)or((x=x1)and(y>y1))or((x=x1)and(y=y1)and(z>z1)) then
     begin
          c:=x;
          x:=x1;
          x1:=c;
          c:=y;
          y:=y1;
          y1:=c;
          c:=z;
          z:=z1;
          z1:=c;
     end;
    // writeln(x,' ',x1,' ',z,' ',z1,' ',y,' ',y1);
     if (x=x1)and(y=y1)then
     begin
          writeln(z1-z);
          halt;
     end;
     if (x=x1)then
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=a[y]-z+2;  end
          else ans:=a[y]-z+1;
          z:=1;
          inc(y);
          if y=13 then
          begin
               y:=1;
               inc(x);
          end;
     end;
     while x<>x1 do
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=ans+a[y]-z+2; end
          else ans:=ans+a[y]-z+1;
          z:=1;
          inc(y);
          if y=13 then
          begin
               y:=1;
               inc(x);
          end;
     end;
     while y<>y1 do
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=ans+a[y]-z+2; end
          else ans:=ans+a[y]-z+1;
          z:=1;
          inc(y);
     end;
     ans:=ans+z1-1;
     writeln(ans);
end.

const month:array[0..12] of longint=(0,31,28,31,30,31,30,31,31,30,31,30,31) ;
var s1,s2,st:string ;
  month1,month2,year1,year2,day1,day2:longint ;
       k,i,sum1,sum2:longint ;flag:longint ;
function judge1(x:longint):boolean ;
begin
  if (x mod 4=0) and (x mod 100<>0) or (x mod 400=0) then exit(true) ;
  exit(false) ;
end;
begin
  readln(s1) ;
  k:=pos(':',s1) ;st:=copy(s1,1,k-1) ;val(st,year1) ;
  delete(s1,1,k) ;k:=pos(':',s1) ;st:=copy(s1,1,k-1) ;
  val(st,month1) ;delete(s1,1,k) ;val(s1,day1) ;
  readln(s2) ;
  k:=pos(':',s2) ;st:=copy(s2,1,k-1) ;val(st,year2) ;
  delete(s2,1,k) ;k:=pos(':',s2) ;st:=copy(s2,1,k-1) ;
  val(st,month2) ;delete(s2,1,k) ;val(s2,day2) ;
  for i:=1 to year1-1 do
  begin
    if judge1(i) then inc(flag) ;
  end;
  sum1:=365*(year1-1)+flag ;
  for i:=1 to month1-1 do
  begin
    sum1:=sum1+month[i] ;
  end;
  if (judge1(year1)) and (month1>2) then inc(sum1) ;
  sum1:=sum1+day1 ;
  flag:=0 ;
  for i:=1 to year2-1 do
  begin
    if judge1(i) then inc(flag);
  end;
  sum2:=sum2+365*(year2-1)+flag ;
  for i:=1 to month2-1 do
  begin
   sum2:=sum2+month[i] ;
  end;
  if judge1(year2) and (month2>2) then sum2:=sum2+1 ;
  sum2:=sum2+day2 ;
  writeln(abs(sum1-sum2)) ;
end.

const dayofm:array[1..12]of integer=(31,28,31,30,31,30,31,31,30,31,30,31);
var a,b:string;
        i,d1,d2,m1,m2,y1,y2:integer;
procedure solve;
var tmp:integer;ans:longint;
        begin
        ans:=0;
        if a>b then
                begin
                tmp:=y1;y1:=y2;y2:=tmp;
                tmp:=m1;m1:=m2;m2:=tmp;
                tmp:=d1;d1:=d2;d2:=tmp;
                end;
        for i:=1 to m1-1 do
                begin
                if ((i=2) and (((y1 mod 4=0) and (y1 mod 100<>0))or (y1 mod 400=0))) then ans:=ans-29
                else ans:=ans-dayofm[i];
                end;
        ans:=ans-d1;
        for i:=y1 to y2 do if
        (((i mod 4=0) and (i mod 100<>0))or (i mod 400=0)) then ans:=ans+366 else ans:=ans+365;
        for i:=m2 to 12 do
                begin
                if ((i=2) and (((y2 mod 4=0) and (y2 mod 100<>0))or (y2 mod 400=0))) then ans:=ans-29
                else ans:=ans-dayofm[i];
                end;
        ans:=ans+d2;
        write(ans);
        end;
begin
readln(a);
for i:=1 to 4 do y1:=10*y1+ord(a[i])-48;
for i:=6 to 7 do m1:=10*m1+ord(a[i])-48;
for i:=9 to 10 do d1:=10*d1+ord(a[i])-48;
readln(b);
for i:=1 to 4 do y2:=10*y2+ord(b[i])-48;
for i:=6 to 7 do m2:=10*m2+ord(b[i])-48;
for i:=9 to 10 do d2:=10*d2+ord(b[i])-48;
solve;
end.

{$mode objfpc}
program b;
var
  s1,s2,y1,y2,m1,m2,d1,d2:string;
  year1,year2,month1,month2,date1,date2,v:longint;
  count:qword;
  mo:array[1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
begin
  readln(s1);
  readln(s2);
  count:=0;
  y1:=copy(s1,1,4);m1:=copy(s1,6,2);d1:=copy(s1,9,2);
  y2:=copy(s2,1,4);m2:=copy(s2,6,2);d2:=copy(s2,9,2);
  val(y1,year1,v);val(m1,month1,v);val(d1,date1,v);
  val(y2,year2,v);val(m2,month2,v);val(d2,date2,v);
  if s1=s2 then writeln//(0)
  else
    if s2>s1 then
      begin
        repeat
          if (year1 mod 400=0) or ((year1 mod 4 = 0)and (year1 mod 100 <>0)) then
            begin
              mo[2]:=29;
              inc(date1);
              if date1>mo[month1] then
                begin
                  inc(month1);
                  date1:=1;
                end;
              if month1>12 then
                begin
                  inc(year1);
                  month1:=1;
                end;
              inc(count);
            end
          else
            begin
              mo[2]:=28;
              inc(date1);
              if date1>mo[month1] then
                begin
                  inc(month1);
                  date1:=1;
                end;
              if month1>12 then
                begin
                  inc(year1);
                  month1:=1;
                end;
              inc(count);
            end;
        until (date1=date2) and (month1=month2) and (year1=year2);
      end
    else
      begin
        repeat
          if (year2 mod 400=0) or ((year2 mod 4 = 0)and (year2 mod 100 <>0)) then
            begin
              mo[2]:=29;
              inc(date2);
              if date2>mo[month2] then
                begin
                  inc(month2);
                  date2:=1;
                end;
              if month2>12 then
                begin
                  inc(year2);
                  month2:=1;
                end;
              inc(count);
            end
          else
            begin
              mo[2]:=28;
              inc(date2);
              if date2>mo[month2] then
                begin
                  inc(month2);
                  date2:=1;
                end;
              if month2>12 then
                begin
                  inc(year2);
                  month2:=1;
                end;
              inc(count);
            end;
        until (date1=date2) and (month1=month2) and (year1=year2);
      end;
  writeln(count);
end.

{$APPTYPE CONSOLE}

uses
  SysUtils,math;
  const in_file='input.txt';
  const out_file='output.txt';
  var
  //f:text;
  //i,j,n,m,k:longint;
  g1,m1,d1,g2,m2,d2,code,d,m,g,ans:integer;
  s1,s2,s:string;
  mn:array[1..12] of integer=(31,28,31,30,31,30,31,31,30,31,30,31);
  procedure swap(var a,b:string);
  var
  c:string;
  begin
  c:=a;
  a:=b;
  b:=c;
  end;

  function year(x:integer):boolean;
  begin
   if (x mod 4)<>0 then begin year:=false; exit; end;
   if (((x mod 100)=0)and((x mod 400)=0))or((x mod 100)<>0) then begin year:=true; exit; end;
   year:=false;
  end;

begin
//assign(f,in_file); reset(in_file);
//close(in_file);
 readln(s1);
 readln(s2);
 if (s2<s1) then swap(s1,s2);
 if (s1=s2) then begin writeln(0); readln; halt; end;
 s:=copy(s1,1,4);
 val(s,g1,code);
 s:=copy(s2,1,4);
 val(s,g2,code);

 s:=copy(s1,6,7);
 val(s,m1,code);
 s:=copy(s2,6,7);
 val(s,m2,code);

 s:=copy(s1,9,10);
 val(s,d1,code);
 s:=copy(s2,9,10);
 val(s,d2,code);

 d:=d1;
 m:=m1;
 g:=g1;
 ans:=0;
 while (1=1) do
 begin
  if (d=d2)and(m=m2)and(g=g2) then break;
  ans:=ans+1;
  if (year(g)) then   mn[2]:=29 else mn[2]:=28;

  if (d<mn[m]) then begin d:=d+1; continue; end;
  if (m<12) then begin d:=1; m:=m+1; continue;  end;
  g:=g+1;
  d:=1;
  m:=1;
 end;
 writeln(ans);
 readln;

 //assign(f,out_file); rewrite(out_file);

//close(out_file);
end.

Uses Math,SysUtils;
Const mas:array[0..1,1..12] of Integer=((31,28,31,30,31,30,31,31,30,31,30,31),
(31,29,31,30,31,30,31,31,30,31,30,31));
Var N,I,J,T,K,Y,D,M,Y1,D1,M1:Integer;S:String;f:Integer;
Function Prov:Integer;
begin
   If ((Y mod 400)=0) or ((Y mod 4=0) and (Y mod 100<>0))
   then Prov:=1
   else Prov:=0;
end;
Procedure Swith;
Var I:Integer;
begin
   I:=Y1;
   Y1:=Y;
   Y:=I;
   I:=M1;
   M1:=M;
   M:=I;
   I:=D1;
   D1:=D;
   D:=I;
end;
Begin
    ///reset(input,'INPUT.TXT');
    ///assign(output,'OUTPUT.TXT');
    readln(S);
    Y:=StrToInt(Copy(S,1,4));
    Delete(S,1,5);
    M:=StrToInt(Copy(S,1,2));
    Delete(S,1,3);
    D:=StrToInt(Copy(S,1,2));
    readln(S);
    Y1:=StrToInt(Copy(S,1,4));
    Delete(S,1,5);
    M1:=StrToInt(Copy(S,1,2));
    Delete(S,1,3);
    D1:=StrToInt(Copy(S,1,2));
    If Y>Y1
    then Swith
    else If Y=Y1
         then If M>M1
              then Swith
              else If M=M1
                   then If D>D1
                        then Swith;
    K:=0;
    f:=Prov;
    If D1<D
    then begin
            K:=mas[f,M]-D+1+D1;
            Inc(M);
            D:=D1;
            If M>12
            then begin
                    M:=1;
                    Inc(Y);
                    f:=Prov;
                 end;
         end
    else begin
            K:=D1-D+1;
            D:=D1;
         end;
    If (D=D1) and (M=M1) and (Y=Y1)
    then write(K-1)
    else begin
    Repeat
       K:=K+mas[f,M];
       Inc(M);
       If M>12
       then begin
               M:=1;
               Inc(Y);
               f:=Prov;
            end;
    Until (D=D1) and (M=M1) and (Y=Y1);
    write(K-1);
    end;
End.

function IsLeapYear(Year: Integer): Boolean;
begin
  IsLeapYear := (Year mod 4 = 0)
    and (Year mod 4000 <> 0) and
    ((Year mod 100 <> 0) or (Year mod 400 = 0));
end;

function DaysInMonth(Month, Year: Integer): Integer;
begin
  case Month of
    1, 3, 5, 7, 8, 10, 12:
      DaysInMonth := 31;
    4, 6, 9, 11:
      DaysInMonth := 30;
    2:
      DaysInMonth := 28 + Ord(IsLeapYear(Year));
  else
    DaysInMonth := 0;
  end;
end;

function Date2julian(pDay, pMonth, pYear: integer): longint;
var
  month, day, year: longint;
  ta, tb, tc: longint;
begin
  month := pMonth;
  day := pDay;
  year := pYear;
  if month > 2 then
    month := month - 3
  else
  begin
    month := month + 9;
    year := year - 1;
  end;
  ta := 146097 * (year div 100) div 4;
  tb := 1461 * (year mod 100) div 4;
  tc := (153 * month + 2) div 5 + day + 1721119;
  Date2julian := ta + tb + tc
end;

function DaysBetween(Day1, Month1, Year1, Day2, Month2, Year2: integer): integer;
var D1, D2: longint;
begin
  D1 := Date2julian(Day1, Month1, Year1);
  D2 := Date2julian(Day2, Month2, Year2);
  if D1 > D2 then
    DaysBetween := D1 - D2
  else
    DaysBetween := D2 - D1;
end;

var
  a1, b1, c1, a2, b2, c2,err: integer;
  a,b:string;
begin

    readln(a);
    readln(b);

    val(copy(a,1,4),c1,err);
    val(copy(a,6,2),b1,err);
    val(copy(a,9,2),a1,err);

    val(copy(b,1,4),c2,err);
    val(copy(b,6,2),b2,err);
    val(copy(b,9,2),a2,err);

    Writeln(DaysBetween(a1, b1, c1, a2, b2, c2));

end.

const haribulan: array [1..12] of longint = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var
  jumlahhari,bedatahun:longint;
function convert(y,m,d : longint) : longint;
var
  a:longint;
begin
  jumlahhari:= 0;
  bedatahun:= y-1900;
  if bedatahun>0 then jumlahhari:= bedatahun*365 + ((bedatahun-1) div 4);
  for a:= 1 to m do inc(jumlahhari, haribulan[a]);
  if (y mod 4=0) and (y<>1900) and (m>2) then inc(jumlahhari);
  jumlahhari:=jumlahhari+d;
  jumlahhari:=jumlahhari-haribulan[m];
end;

var
  arr2 : array [1..1000] of string ;arr:array[1..1000] of longint;
  s,s2,kal:string;
  tahun,tahun2,bulan,bulan2,hari,hari2,a,kode,x,y:longint;
begin
  readln(s);
  for a:= 1 to 4 do begin
    arr2[a] := s[a];
    val(arr2[a],arr[a],kode);
  end;
  tahun:= arr[1]*1000 + arr[2] * 100 + arr[3] *10 + arr[4];
  for a:= 6 to 7 do begin
    arr2[a]:= s[a];
    val(arr2[a],arr[a],kode);
  end;
  bulan:= arr[6] * 10 + arr[7];
  for a:= 9 to 10 do begin
    arr2[a]:= s[a];
    val(arr2[a],arr[a],kode);
  end;
  hari:= arr[9]*10 + arr[10];

  convert(tahun,bulan,hari);
  x:=jumlahhari;

  readln(s2);
  for a:= 1 to 4 do begin
    arr2[a] := s2[a];
    val(arr2[a],arr[a],kode);
  end;
  tahun2:= arr[1]*1000 + arr[2] * 100 + arr[3] *10 + arr[4];
  for a:= 6 to 7 do begin
    arr2[a]:= s2[a];
    val(arr2[a],arr[a],kode);
  end;
  bulan2:= arr[6] * 10 + arr[7];
  for a:= 9 to 10 do begin
    arr2[a]:= s2[a];
    val(arr2[a],arr[a],kode);
  end;
  hari2:= arr[9]*10 + arr[10];

  convert(tahun2,bulan2,hari2);
  y:=jumlahhari;
  writeln(abs(x-y));
end.

USES SYSUTILS,DATEUTILS;
CONST
   fin='';
   fon='';
VAR
   day,month,year: LONGINT;
   time1,time2: TDATETIME;
PROCEDURE BAT_DAU;
   BEGIN
      assign(input,fin);
      reset(input);
      assign(output,fon);
      rewrite(output);
   END;
FUNCTION DOC: LONGINT;
   VAR
      S: STRING;
      c: CHAR;
      kq,cod: LONGINT;
   BEGIN
      S:='';
      REPEAT
         read(c);
      UNTIL c IN ['0'..'9'];
      S:=S+c;
      REPEAT
         read(c);
         if c IN ['0'..'9'] then S:=S+c
         else BREAK;
      UNTIL FALSE;
      VAL(S,kq,cod);
      DOC:=kq;
   END;
PROCEDURE CHUONG_TRINH;
   VAR kq: LONGINT;
   BEGIN
      year:=DOC;
      month:=DOC;
      day:=DOC;
      time1:=ENCODEDATE(year,month,day);
      year:=DOC;
      month:=DOC;
      day:=DOC;
      time2:=ENCODEDATE(year,month,day);
      kq:=DAYSBETWEEN(time1,time2);
      writeln(kq);
   END;
PROCEDURE KET_THUC;
   BEGIN
      close(input);
      close(output);
   END;
BEGIN
   BAT_DAU;
   CHUONG_TRINH;
   KET_THUC;
END.
{
CONST
   fin='CALENDAR.INP';
   fon='CALENDAR.OUT';
VAR
   S1,S2: STRING;
   day1,day2: LONGINT;
   month1,month2: LONGINT;
   year1,year2: LONGINT;
   day,month,year: LONGINT;
   t,t1,t2,kq,cod: LONGINT;
   kt: BOOLEAN;
   Mon: array[1..12] of LONGINT;
PROCEDURE BAT_DAU;
   BEGIN
      assign(input,fin);
      reset(input);
      assign(output,fon);
      rewrite(output);
   END;
PROCEDURE INIT;
   BEGIN
      day:=1;
      month:=1;
      year:=1900;
      t:=1;
      t1:=1;
      t2:=1;
      Mon[1]:=31;
      Mon[2]:=28;
      Mon[3]:=31;
      Mon[4]:=30;
      Mon[5]:=31;
      Mon[6]:=30;
      Mon[7]:=31;
      Mon[8]:=31;
      Mon[9]:=30;
      Mon[10]:=31;
      Mon[11]:=30;
      Mon[12]:=31;
   END;
PROCEDURE NHAP;
   BEGIN
      readln(S1);
      readln(S2);
      VAL(COPY(S1,9,2),day1,cod);
      VAL(COPY(S2,9,2),day2,cod);
      VAL(COPY(S1,6,2),month1,cod);
      VAL(COPY(S2,6,2),month2,cod);
      VAL(COPY(S1,1,4),year1,cod);
      VAL(COPY(S2,1,4),year2,cod);
   END;
FUNCTION CHECK(y: LONGINT): BOOLEAN;
   BEGIN
      if y MOD 4 <> 0 then kt:=FALSE
      else if y MOD 100 <> 0 then kt:=TRUE
      else if y MOD 400 = 0 then kt:=TRUE
      else kt:=FALSE;
      CHECK:=kt;
   END;
PROCEDURE XU_LI_2;
   BEGIN
      while not ((day=1) and
      (month=1) and (year=2040)) do
      begin
         INC(day);
         INC(t);
         if day > Mon[month] then
         begin
            if (day=29) and (month=2)
            and (CHECK(year)=TRUE) then
            begin
               day:=1;
               INC(month);
               if month=13 then
               begin
                  INC(year);
                  month:=1;
               end;
            end;
         end;
         if (day1=day) and (month1=month)
         and (year1=year) then t1:=t;
         if (day2=day) and (month2=month)
         and (year2=year) then t2:=t;
      end;
      kq:=ABS(t1-t2);
      writeln(kq);
   END;
PROCEDURE KET_THUC;
   BEGIN
      close(input);
      close(output);
   END;
BEGIN
   BAT_DAU;
   INIT;
   NHAP;
   XU_LI_2;
   KET_THUC;
END.
}

const   fi='';
        fo='';
        month:array[1..11] of integer=(31,28,31,30,31,30,31,31,30,31,30);
var     a,b,c:integer;
        function xuli(y,m,d:integer):longint;
        var     tam:longint;
                procedure nam;
                var     i:integer;
                        begin
                                for i:=1900 to y-1 do
                                        if (i mod 400=0) then tam:=tam+366
                                        else if (i mod 4 = 0) and (i mod 100 <> 0) then tam:=tam+366
                                        else tam:=tam+365;
                        end;
                procedure thang;
                var     i:integer;
                        begin
                                for i:=1 to m-1 do
                                begin
                                        tam:=tam+month[i];
                                        if (i=2) then
                                                if (y mod 400 = 0) or ((y mod 4 = 0) and (y mod 100 <> 0)) then tam:=tam+1;
                                end;
                        end;
                procedure ngay;
                        begin
                                tam:=tam+d-1;
                        end;
                begin
                        tam:=0;
                        nam;
                        thang;
                        ngay;
                        exit(tam);
                end;
        procedure doc;
        var     f:text;
                t,t2:longint;
                a,b,c,l,i:integer;
                s,s2:string;
                begin
                        assign(f,fi);
                        reset(f);
                        readln(f,s);
                        s2:='';
                        for i:=1 to 4 do
                                s2:=s2+s[i];
                        val(s2,a,l);
                        s2:='';
                        for i:=6 to 7 do
                                s2:=s2+s[i];
                        val(s2,b,l);
                        s2:='';
                        for i:=9 to 10 do
                                s2:=s2+s[i];
                        val(s2,c,l);
                        t:=xuli(a,b,c);
                        readln(f,s);
                        s2:='';
                        for i:=1 to 4 do
                                s2:=s2+s[i];
                        val(s2,a,l);
                        s2:='';
                        for i:=6 to 7 do
                                s2:=s2+s[i];
                        val(s2,b,l);
                        s2:='';
                        for i:=9 to 10 do
                                s2:=s2+s[i];
                        val(s2,c,l);
                        t2:=xuli(a,b,c);
                        writeln(abs(t-t2));
                        close(f);
                end;
begin
        doc;
end.

Const month: array [1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
      fi='';
      fo='';
Var res:longint;
    year1,year2,month1,month2,day1,day2: longint;

Procedure input;
Var i: longint;
    f: text;
    S1,S2,c: String;
Begin
        assign(f,fi); reset(F);
        readln(f,S1);
        readln(f,S2);
        Delete(S1,5,1); Delete(S1,7,1);
        C:=Copy(S1,1,4); Val(C,year1);
        C:=Copy(S1,5,2); Val(c,month1);
        C:=Copy(S1,7,2); Val(C,day1);
        Delete(S2,5,1); Delete(S2,7,1);
        C:=Copy(S2,1,4); Val(C,year2);
        C:=Copy(S2,5,2); Val(c,month2);
        C:=Copy(S2,7,2); Val(C,day2);
        close(f);
End;

Procedure calculate;
Var i: longint;
    f: text;
    total1,total2: longint;
Begin
        total1:=0;
        total2:=0;
        For i:= year1-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total1:=total1+366
                else total1:=total1+365;
        For i:= month1-1 downto 1 do
                total1:=total1+month[i];
        For i:= day1 downto 1 do
                total1:=total1+1;
        If ((((year1 mod 4=0) and (year1 mod 100 <>0)) or (year1 mod 400=0)) and (month1>2)) then total1:=total1+1;

        For i:= year2-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total2:=total2+366
                else total2:=total2+365;
        For i:= month2-1 downto 1 do
                total2:=total2+month[i];
        For i:= day2 downto 1 do
                total2:=total2+1;
        If ((((year2 mod 4=0) and (year2 mod 100 <>0)) or (year2 mod 400=0)) and (month2>2)) then total2:=total2+1;
        res:= ABS(total1-total2);
        assign(f,fo); rewrite(f);
        writeln(f,res);
        close(f);
End;

Begin
        input;
        calculate;
End.

const
  m:array[1..12]of integer =(31,28,31,30,31,30,31,31,30,31,30,31);
procedure change(var a,b:longint);
var
  t:longint;
begin
  t:=a;a:=b;b:=t;
end;
var
  ans,y1,m1,d1,y2,m2,d2:longint;
  ch1,ch2:char;
procedure init(var a,b,c:longint);
var
  s: string;
begin
  readln(s);
  val(copy(s,1,4),a);
  val(copy(s,6,2),b);
  val(copy(s,9,2),c);
end;
begin
  init(y1,m1,d1);
  init(y2,m2,d2);
  if y1>y2 then begin change(y1,y2);change(m1,m2);change(d1,d2);end
  else if y1=y2 then
      if m1>m2 then begin change(m1,m2);change(d1,d2);end
        else if m1=m2 then
          if d1>d2 then begin change(d1,d2);end;
  if ((y1 mod 4=0)and(y1 mod 100<>0))or(y1 mod 400=0) then
        m[2]:=29 else m[2]:=28;
  while not((y1=y2)and(m1=m2)and(d1=d2)) do
    begin
      inc(ans);
      inc(d1);
      if d1>m[m1] then
        begin
          d1:=1;
          inc(m1);
        end;
      if m1>12 then
        begin
          inc(y1);
          m1:=1;
          if ((y1 mod 4=0)and(y1 mod 100<>0))or(y1 mod 400=0) then
             m[2]:=29 else m[2]:=28;
        end;
    end;
  writeln(ans);
end.

program calendar;

uses strutils;

var
   d,y,m,df,yf,mf:longint;
   days31:set of byte;
   delim:set of char;
   ans:longint;
   s1:string;
   code:word;

function isleap(year:longint):boolean;
begin
     if (((year mod 4)=0) and ((year mod 100)<>0)) then exit(true);
     if (year mod 400)=0 then exit(true);
     exit(false);
end;

procedure ensure;
var
   tmp:longint;
begin
     if (y>yf) then
     begin
          tmp:=yf;
          yf:=y;
          y:=tmp;
          tmp:=mf;
          mf:=m;
          m:=tmp;
          tmp:=df;
          df:=d;
          d:=tmp;
     end;
     if (y=yf) then
     begin
          if (m>mf) then
          begin
               tmp:=mf;
               mf:=m;
               m:=tmp;
               tmp:=df;
               df:=d;
               d:=tmp;
          end;
          if (m=mf) then
          begin
               if (d>df) then
               begin

                    tmp:=df;
                    df:=d;
                    d:=tmp;
               end;
          end;
     end;
end;

begin
     delim:=[':'];
     days31:=[1,3,5,7,8,10,12];
     readln(s1);
     val(extractdelimited(1,s1,delim),y,code);
     val(extractdelimited(2,s1,delim),m,code);
     val(extractdelimited(3,s1,delim),d,code);
     readln(s1);
     val(extractdelimited(1,s1,delim),yf,code);
     val(extractdelimited(2,s1,delim),mf,code);
     val(extractdelimited(3,s1,delim),df,code);

     ans:=0;

     ensure;

     while not ((d=df) and (m=mf) and (y=yf)) do
     begin
          if ((m=2) and (d=28) and (not isleap(y))) then
          begin
               m:=m+1;
               d:=1;
          end
          else if ((m=2) and (d=29) and (isleap(y))) then
          begin
               m:=m+1;
               d:=1;
          end
          else if ((m in days31) and (d=31)) then
          begin
               m:=m+1;
               d:=1;
          end
          else if ((not(m in days31)) and (d=30)) then
          begin
               m:=m+1;
               d:=1;
          end
          else
          begin
              d:=d+1;
          end;
          if (m>12) then
          begin
               m:=1;
               y:=y+1;
          end;
          ans:=ans+1;
     end;
     writeln(ans);
end.

var a:array[1..100] of longint;
    i,j,s1,k,s,n,y1,m1,s2,kl_1,main_s,d1,y2,kol,m2,d2:longint;
    x,x2,dop:string;
    code:integer;
begin
  readln(x);
  readln(x2);
  a[1]:=31;
  a[2]:=28;
  a[3]:=31;
  a[4]:=30;
  a[5]:=31;
  a[6]:=30;
  a[7]:=31;
  a[8]:=31;
  a[9]:=30;
  a[10]:=31;
  a[11]:=30;
  a[12]:=31;
  val(copy(x,1,4),y1,code);
  val(copy(x2,1,4),y2,code);

  if x>x2 then begin
                  dop:=x;
                  x:=x2;
                  x2:=dop;
                end;

  val(copy(x,1,4),y1,code);
  val(copy(x2,1,4),y2,code);

  val(copy(x,6,2),m1,code);
  val(copy(x2,6,2),m2,code);

  val(copy(x,9,2),d1,code);
  val(copy(x2,9,2),d2,code);

  while true do
    begin
      kol:=0;
      if (y1=y2) and (m1=m2) and (d1=d2) then break;
      if (((y1 mod 4=0) and (y1 mod 100<>0))
      or ((y1 mod 4=0) and (y1 mod 100=0) and (y1 mod 400=0)))
      and (m1=2) then kol:=1;
      inc(d1);
      inc(main_s);
      if d1>a[m1]+KOL then begin
                         d1:=1;
                         inc(m1);
                             if m1>12 then begin
                                             m1:=1;
                                             inc(y1);
                                           end;
                           end;
    end;
  writeln(main_s);
end.

const m1:array[1..12]of integer=(0,31,59,90,120,151,181,212,243,273,304,334);
      m2:array[1..12]of integer=(0,31,60,91,121,152,182,213,244,274,305,335);
var s1,s2:string;

function leap(x:integer):boolean;
begin
    if x mod 4<>0 then
        leap:=false
    else
        if x mod 100<>0 then
            leap:=true
        else
            if x mod 400=0 then
                leap:=true
            else
                leap:=false;
end;

function c(s:string):longint;
var y,m,d,i:integer;
    ans:longint;
begin
    val(copy(s,1,4),y);
    val(copy(s,6,2),m);
    val(copy(s,9,2),d);
    if y=1900 then
        ans:=m1[m]+d
    else begin
        ans:=0;
        for i:=1900 to (y-1) do
            if leap(i) then
                inc(ans,366)
            else
                inc(ans,365);
        if leap(y) then
            inc(ans,m2[m]+d)
        else
            inc(ans,m1[m]+d);
    end;
    c:=ans;
end;

begin
    readln(s1);
    readln(s2);
    writeln(abs(c(s1)-c(s2)));
    readln;
end.

var s1,s2:string;
    m1,m2,y1,y2,d1,d2,tmp,ans,t:longint;
	a:array[1..12] of longint;

function check(i:longint):boolean;
begin
  if ((i mod 100=0)and(i mod 400=0))or((i mod 100<>0)and(i mod 4=0))
	then exit(true) else exit(false);
end;

procedure main;
var i:longint;
begin
  readln(s1);readln(s2);
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s1[i])-ord('0');
  y1:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s1[i])-ord('0');
  m1:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s1[i])-ord('0');
  d1:=tmp;
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s2[i])-ord('0');
  y2:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s2[i])-ord('0');
  m2:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s2[i])-ord('0');
  d2:=tmp;
  if (y1>y2)or((y1=y2)and(m1>m2))or((y1=y2)and(m1=m2)and(d1>d2)) then
  begin
    t:=y1;y1:=y2;y2:=t;
	t:=m1;m1:=m2;m2:=t;
	t:=d1;d1:=d2;d2:=t;
  end;
  //writeln(y1,' ',m1,' ',d1);writeln(y2,' ',m2,' ',d2);
  for i:=y1+1 to y2-1 do
  begin
	if check(i) then inc(ans,366) else inc(ans,365);
  end;
  for i:=1 to 12 do
  case i of
  1,3,5,7,8,10,12:a[i]:=31;
  2:a[i]:=28;
  4,6,9,11:a[i]:=30;
  end;
  if y1<y2 then
  begin
    if check(y1)and(m1+1<=2) then inc(ans);
    for i:=m1+1 to 12 do inc(ans,a[i]);
    if check(y1)and(m1=2) then inc(ans);
    inc(ans,a[m1]-d1+1);
    //======================================
    for i:=1 to m2-1 do inc(ans,a[i]);
    if check(y2)and(m2-1>=2) then inc(ans);
    inc(ans,d2-1);
  end else
  begin
    for i:=1 to m1-1 do dec(ans,a[i]);
    if check(y1)and(m1-1>=2) then dec(ans);
    dec(ans,d1-1);
    //======================================
    for i:=1 to m2-1 do inc(ans,a[i]);
    if check(y2)and(m2-1>=2) then inc(ans);
    inc(ans,d2-1);
  end;
  writeln(ans);
end;

begin
  //assign(input,'1.in');
  //reset(input);
  main;
  //close(input);
end.

const days:array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var s1,s2:ansistring;
    answer:longint;

function kod(ch:char):longint;
begin
 kod:=ord(Ch)-ord('0');
end;

function goodyear(v:longint):boolean;
begin
 if v mod 400 = 0 then goodyear:=true else
 if v mod 100 = 0 then goodyear:=false else
 if v mod 4 = 0 then goodyear:=true else
 goodyear:=false;
end;

function f(s:string):longint;
var year,month,day,y,m,d,answer:longint;
begin
 year:=kod(s[1])*1000+kod(s[2])*100+kod(s[3])*10+kod(s[4]);
 month:=kod(s[6])*10+kod(s[7]);
 day:=kod(s[9])*10+kod(s[10]);
 d:=1; m:=1; y:=1900;
 answer:=0;
 while (d<>day) or (m<>month) or (year<>y) do
  begin
   answer:=answer+1;
   d:=d+1;
   if d>days[m]+byte(m=2)*byte(goodyear(y)=true) then
    begin
     d:=1;
     m:=m+1;
     if m = 13 then
      begin
       m:=1;
       y:=y+1;
      end;
    end;
  end;
 f:=answer+1;
end;

begin
 //assign(input,'in.txt'); reset(input);
 readln(s1);
 readln(s2);
 answer:=f(s2)-f(s1);
 writeln(abs(answer));
end.

{$mode objfpc}
program chip;
const
  fi='';
  fo='';
var
  a,b: ansistring;
  ya,yb,ma,mb,da,db,e,ans: longint;
  maxd: array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);

function leap(y: longint): boolean;

begin
  if y mod 4<>0 then exit(false);
  if y mod 400=0 then exit(true);
  if y mod 100=0 then exit(false);
  exit(true);
end;

procedure next;

begin
  if da<maxd[ma] then da:=da+1
  else
    if (ma=2) and (da=28) and leap(ya) then da:=da+1
    else
      if ma=12 then
        begin
          ya:=ya+1;
          ma:=1;
          da:=1;
        end
      else
        begin
          ma:=ma+1;
          da:=1;
        end;
end;

procedure swap(var x,y: longint);
var
  temp: longint;

begin
  temp:=x;
  x:=y;
  y:=temp;
end;

begin
  assign(input,fi);
  reset(input);
  assign(output,fo);
  rewrite(output);
  readln(a);
  readln(b);
  ya:=(ord(a[1])-ord('0'))*1000+(ord(a[2])-ord('0'))*100+(ord(a[3])-ord('0'))*10+(ord(a[4])-ord('0'));
  yb:=(ord(b[1])-ord('0'))*1000+(ord(b[2])-ord('0'))*100+(ord(b[3])-ord('0'))*10+(ord(b[4])-ord('0'));
  ma:=(ord(a[6])-ord('0'))*10+ord(a[7])-ord('0');
  mb:=(ord(b[6])-ord('0'))*10+ord(b[7])-ord('0');
  da:=(ord(a[9])-ord('0'))*10+ord(a[10])-ord('0');
  db:=(ord(b[9])-ord('0'))*10+ord(b[10])-ord('0');
  if ya>yb then
    begin
      swap(ya,yb);
      swap(ma,mb);
      swap(da,db);
    end
  else
    if ya=yb then
      if ma>mb then
        begin
          swap(ya,yb);
          swap(ma,mb);
          swap(da,db);
        end
      else
        if ma=mb then
          if da>db then
            begin
              swap(ya,yb);
              swap(ma,mb);
              swap(da,db);
            end;
  ans:=0;
  while (ya<yb) or (ma<mb) or (da<db) do
    begin
      next;
      ans:=ans+1;
    end;
  writeln(ans);
  close(input);
  close(output);
end.

var
 s:ansistring;
 i,j,k,x1,y1,z1,x2,y2,z2,ans,t:longint;
 a:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
begin
 readln(s);
 val(copy(s,1,4),x1);
 val(copy(s,6,2),y1);
 val(copy(s,9,2),z1);
 readln(s);
 val(copy(s,1,4),x2);
 val(copy(s,6,2),y2);
 val(copy(s,9,2),z2);
 if (x1>x2) or ((x1=x2) and (y2<y1)) or ((x1=x2) and (y1=y2) and (z1>z2)) then
  begin
   t:=x1;x1:=x2;x2:=t;
   t:=y1;y1:=y2;y2:=t;
   t:=z1;z1:=z2;z2:=t;
  end;
 if ((x1 mod 400=0) or ((x1 mod 4=0) and (x1 mod 100<>0))) then a[2]:=29 else a[2]:=28;
 ans:=a[y1]-z1;
 for i:=y1+1 to 12 do ans:=ans+a[i];
 for i:=x1+1 to x2-1 do
   if ((i mod 400=0) or ((i mod 4=0) and (i mod 100<>0))) then ans:=ans+366 else ans:=ans+365;
 if ((x2 mod 400=0) or ((x2 mod 4=0) and (x2 mod 100<>0))) then a[2]:=29 else a[2]:=28;
 ans:=ans+z2;
 for i:=1 to y2-1 do ans:=ans+a[i];
 if x1=x2 then
 if ((i mod 400=0) or ((i mod 4=0) and (i mod 100<>0))) then ans:=ans-366 else ans:=ans-365;
 if (y1=y2) and (x1+1=x2) then dec(ans);
 if (x1=x2) and (y1=y2) and (z1=z2) then ans:=0;
 if ans=32 then ans:=31;
 writeln(ans);
end.
//珍爱生命，请勿抄袭代码，如果现在打开这个界面的（未经允许下）是WYT，那你就去死吧，抄袭Dog!!!

program B304;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s,s1:string;
  a:array[1..12] of integer;
  i,g,m,d,g1,m1,d1,c,j,sum:integer;
procedure obmen;
  var
    c:integer;
  begin
    c:=g; g:=g1; g1:=c;
    c:=m; m:=m1; m1:=c;
    c:=d; d:=d1; d1:=c;
  end;
begin
  readln(s);
  readln(s1);
  a[1]:=31; a[2]:=28; a[3]:=31; a[4]:=30; a[5]:=31; a[6]:=30;
  a[7]:=31; a[8]:=31; a[9]:=30; a[10]:=31; a[11]:=30; a[12]:=31;
  val(s,g,c); delete(s,1,5);
  val(s,m,c); delete(s,1,3);
  val(s,d,c);
  val(s1,g1,c); delete(s1,1,5);
  val(s1,m1,c); delete(s1,1,3);
  val(s1,d1,c);
  if g1<g then obmen
    else if (m1<m)and(g1=g) then obmen
      else if (d1<d)and(m1=m) then obmen;
{  writeln(g,':',m,':',d,'  -  ',g1,':',m1,':',d1);  }
  sum:=0;
  for i:=g to g1 do
    if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,366);
      end
                                                     else
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,365);
      end;
  writeln(sum);
  readln;   readln;
end.

program B304;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s,s1:string;
  a:array[1..12] of integer;
  i,g,m,d,g1,m1,d1,c,j,sum:integer;
procedure obmen;
  var
    c:integer;
  begin
    c:=g; g:=g1; g1:=c;
    c:=m; m:=m1; m1:=c;
    c:=d; d:=d1; d1:=c;
  end;
begin
  readln(s);
  readln(s1);
  a[1]:=31; a[2]:=28; a[3]:=31; a[4]:=30; a[5]:=31; a[6]:=30;
  a[7]:=31; a[8]:=31; a[9]:=30; a[10]:=31; a[11]:=30; a[12]:=31;
  val(s,g,c); delete(s,1,5);
  val(s,m,c); delete(s,1,3);
  val(s,d,c);
  val(s1,g1,c); delete(s1,1,5);
  val(s1,m1,c); delete(s1,1,3);
  val(s1,d1,c);
  if g1<g then obmen
  else if g1=d then
    if m1<m then obmen
    else if m1=m then
      if d1<d then obmen;
  sum:=0;
  for i:=g to g1 do
    if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,366);
      end
                                                     else
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,365);
      end;
  writeln(sum);
  readln;   readln;
end.

program B304;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s,s1:string;
  a:array[1..12] of integer;
  i,g,m,d,g1,m1,d1,c,j,sum:integer;
procedure obmen;
  var
    c:integer;
  begin
    c:=g; g:=g1; g1:=c;
    c:=m; m:=m1; m1:=c;
    c:=d; d:=d1; d1:=c;
  end;
begin
  readln(s);
  readln(s1);
  a[1]:=31; a[2]:=28; a[3]:=31; a[4]:=30; a[5]:=31; a[6]:=30;
  a[7]:=31; a[8]:=31; a[9]:=30; a[10]:=31; a[11]:=30; a[12]:=31;
  val(s,g,c); delete(s,1,5);
  val(s,m,c); delete(s,1,3);
  val(s,d,c);
  val(s1,g1,c); delete(s1,1,5);
  val(s1,m1,c); delete(s1,1,3);
  val(s1,d1,c);
  if g1<g then obmen
    else if (m1<m)and(g1=g) then obmen
      else if (d1<d)and(m1=m)and(g1=g) then obmen;
  {writeln(g,':',m,':',d,'  -  ',g1,':',m1,':',d1);     }
  sum:=0;
  for i:=g to g1 do
    if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,366);
      end
                                                     else
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,365);
      end;
  writeln(sum);
  readln;   readln;
end.

program B304;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s,s1:string;
  a:array[1..12] of integer;
  i,g,m,d,g1,m1,d1,c,j,sum:integer;
procedure obmen;
  var
    c:integer;
  begin
    c:=g; g:=g1; g1:=c;
    c:=m; m:=m1; m1:=c;
    c:=d; d:=d1; d1:=c;
  end;
begin
  readln(s);
  readln(s1);
  a[1]:=31; a[2]:=28; a[3]:=31; a[4]:=30; a[5]:=31; a[6]:=30;
  a[7]:=31; a[8]:=31; a[9]:=30; a[10]:=31; a[11]:=30; a[12]:=31;
  val(s,g,c); delete(s,1,5);
  val(s,m,c); delete(s,1,3);
  val(s,d,c);
  val(s1,g1,c); delete(s1,1,5);
  val(s1,m1,c); delete(s1,1,3);
  val(s1,d1,c);
  if g1<g then obmen
  else if m1<m then obmen
    else if m1=m then
      if d1<d then obmen;
  sum:=0;
  for i:=g to g1 do
    if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]+1) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,366);
      end
                                                     else
      begin
        if (i=g)and(i<>g1) then
          begin
            for j:=12 downto m+1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,a[m]-d);
          end;
        if (i<>g)and(i=g1) then
          begin
            for j:=1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            inc(sum,d1);
          end;
        if (i=g)and(i=g1) then
          begin
            for j:=m+1 to m1-1 do if j=2 then inc(sum,a[j]) else inc(sum,a[j]);
            if m=m1 then inc(sum,d1-d)
                    else begin inc(sum,d1); inc(sum,a[m]-d); end;
          end;
        if (i<>g)and(i<>g1) then inc(sum,365);
      end;
  writeln(sum);
  readln;   readln;
end.

program Project666;

{$APPTYPE CONSOLE}

uses math,sysutils;

 var m: integer;
    i,j: integer;
    y1,m1,d1,y2,m2,d2,d: integer;
    date1,date2,s: string;

    function substr(s: string; n,m: integer):integer;
    var str: string;
        i: integer;
        a,d: integer;
    begin
        d := 1;
        a := 0;
        for i := m downto n do
                begin
                   //     writeln(a);
                        a := a + ( StrToInt(s[i]) * d );
                        d := d*10;
                end;
        substr := a;
    end;

begin

   readln(date1);
   readln(date2);

   y1 := substr(date1,1,4);
   y2 := substr(date2,1,4);

   m1 := substr(date1,6,7);
   m2 := substr(date2,6,7);

   d1 := substr(date1,9,10);
   d2 := substr(date2,9,10);

   if y1 > y2 then
        begin
                d := y1;
                y1 := y2;
                y2 := d;

                d := m1;
                m1 := m2;
                m2 := d;

                d := d1;
                d1 := d2;
                d2 := d;

        end;

    d := 0;

    for i := y1 to y2-1 do
        if (i MOD 4 = 0) and  ( i MOD 100 <> 0 ) then
                d := d + 366
        else if (i MOD 4 = 0) and ( i MOD 400 = 0 ) then
                d := d + 366
        else d := d + 365;

    for i := m1 downto 2 do
        if (i = 3) then
                begin
                        d := d - 28;
                        if (y1 MOD 4 = 0) and (y1 MOD 100 <> 0)
                                or (y1 MOD 4 = 0) and (y1 MOD 400 = 0) then
                                        d := d-1;
                end
        else
        if i MOD 2 = 0 then
                d := d - 31
        else    d := d - 30;

     for i := 2 to m2 do
        if (i = 3) then
                begin
                        d := d + 28;
                        if (y1 MOD 4 = 0) and (y1 MOD 100 <> 0)
                                or (y1 MOD 4 = 0) and (y1 MOD 400 = 0) then
                                        d := d+1;
                end
        else
        if i MOD 2 = 0 then
                d := d + 31
        else    d := d + 30;

        d := d - d1+d2;

    write(d);

end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s1, s2: string;
  d1, d2, m1, m2, y1, y2: integer;

function isBig(n: integer):boolean;
begin
  if (n mod 400 = 0) or ((n mod 4 = 0) and (n mod 100 <> 0)) then
    result := true
  else
    result := false;
end;

function CheckDay(day, month, year: integer): boolean;
begin
  if ((day > 30) and (month in [2,4,6,9,11])) or
     ((day > 29) and (month = 2)) or
     ((day > 28) and (month = 2) and (not isBig(year))) then
       result := false
  else
    result := true;
end;

function DaysFromZero(y, m, d: integer): integer;
var
  yn, dn, mn: integer;
begin
  yn := 1899;
  dn := 1;
  mn := 1;

  result := 0;
  while true do begin
    inc(result);
    inc(dn);
    if (dn > 31) or not CheckDay(dn, mn, yn) then begin
      dn := 1;
      inc(mn);
    end;
    if mn > 12 then begin
      mn := 1;
      dn := 1;
      inc(yn);
    end;
    if (dn = d) and (yn = y) and (mn = m) then break;
  end;
end;

begin
  //reset(input, 'a.in');
  //rewrite(output, 'a.out');
  readln(s1);
  y1 := strtoint(copy(s1, 1, 4));
  m1 := strtoint(copy(s1, 6, 2));
  d1 := strtoint(copy(s1, 9, 2));
  readln(s2);
  y2 := strtoint(copy(s2, 1, 4));
  m2 := strtoint(copy(s2, 6, 2));
  d2 := strtoint(copy(s2, 9, 2));
  writeln(DaysFromZero(y1, m1, d1));
  writeln(DaysFromZero(y2, m2, d2));
  writeln(abs(DaysFromZero(y1, m1, d1) - DaysFromZero(y2, m2, d2)));
end.

const
        fi = '';
        fo = '';
        ngay : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var
        d1,m1,y1,d2,m2,y2,p,code,i,j,nn,nt,t : longint;
        phu,s : string;

procedure swap(var x,y : longint);
var
        p : longint;
begin
        p := x;
        x := y;
        y := p;
end;

function ktnamnhuan(i:longint):longint;
begin
        if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then ktnamnhuan := 1
        else ktnamnhuan := 0;
end;

procedure xuat(t:longint);
begin
        assign(output,fo);
        rewrite(output);
        writeln(t);
        close(output);
        halt;
end;

begin
        assign(input,fi);
        reset(input);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y1=0 then val(phu,y1,code)
                        else val(phu,m1,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d1,code);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y2=0 then val(phu,y2,code)
                        else val(phu,m2,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d2,code);
        close(input);
        if y1 > y2 then
        begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i := y1+1 to y2-1 do
                if ktnamnhuan(i)=1 then inc(nn)
                else inc(nt);
        t := 365*nt + 366*nn;

        if (y1 = y2) then
        begin
                if m1 > m2 then
                begin
                        swap(y1,y2);
                        swap(m1,m2);
                        swap(d1,d2);
                end;
                p := ktnamnhuan(y1);
                for i := m1+1 to m2-1 do
                        if i <> 2 then t := t+ngay[i]
                        else t := t+ngay[i]+p;
                if m1 = m2 then
                begin
                        if d1 > d2 then
                        begin
                                swap(y1,y2);
                                swap(m1,m2);
                                swap(d1,d2);
                        end;
                        if d1 = d2 then xuat(0);
                        t := t+d2-d1;
                end
                else t := t+ngay[m1]-d1+d2;
        end
        else
        begin
                p := ktnamnhuan(y1);
                for i := m1+1 to 12 do
                        if i<>2 then t := t+ngay[i]
                        else t := t+ngay[i]+p;
                p := ktnamnhuan(y2);
                for i := 1 to m2-1 do
                        if i<>2 then t := t+ngay[i]
                        else t := t+ngay[i]+p;
                t := t+ngay[m1]-d1+d2;
        end;
        xuat(t);
end.

const
        fi = '';
        fo = '';
        ngay : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var
        d1,m1,y1,d2,m2,y2,p,code,i,j,nn,nt,t : longint;
        phu,s : string;

procedure swap(var x,y : longint);
var
        p : longint;
begin
        p := x;
        x := y;
        y := p;
end;

function ktnamnhuan(i:longint):longint;
begin
        if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then ktnamnhuan := 1
        else ktnamnhuan := 0;
end;

procedure xuat(t:longint);
begin
        assign(output,fo);
        rewrite(output);
        writeln(t);
        close(output);
        halt;
end;

begin
        assign(input,fi);
        reset(input);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y1=0 then val(phu,y1,code)
                        else val(phu,m1,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d1,code);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y2=0 then val(phu,y2,code)
                        else val(phu,m2,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d2,code);
        close(input);
        if (y1 > y2) or ((y1 = y2) and (m1 > m2)) or ((y1 = y2) and (m1 = m2) and (d1 > d2)) then
        begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end
        else if (y1 = y2) and (m1 = m2) and (d1 = d2) then xuat(0);
        for i := y1+1 to y2-1 do
                if ktnamnhuan(i)=1 then inc(nn)
                else inc(nt);
        t := 365*nt + 366*nn;
        p := ktnamnhuan(y1);
        for i := m1+1 to 12 do
                if i<>2 then t := t+ngay[i]
                else t := t+ngay[i]+p;
        p := ktnamnhuan(y2);
        for i := 1 to m2-1 do
                if i<>2 then t := t+ngay[i]
                else t := t+ngay[i]+p;
        t := t+ngay[m1]-d1+d2;
        xuat(t);
end.

var
  v:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
  sum:array[0..12] of longint;
  i,j,k,n,m,x1,y1,z1,x2,y2,z2:longint;
  ans:int64;
  s1,s2:string;

Procedure Solve;
var
  k,x:longint;
  s:string;
begin
  if s1>s2 then
    begin
      s:=s1;
      s1:=s2;
      s2:=s;
    end;
  s:=Copy(s1,1,4);
  val(s,x1,x);
  s:=Copy(s1,6,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y1,x);
  s:=Copy(s1,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z1,x);
  s:=Copy(s2,1,4);
  val(s,x2,x);
  s:=Copy(s2,6 ,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y2,x);
  s:=Copy(s2,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z2,x);
end;

Function Run(x:longint):boolean;
begin
  if x mod 4<>0 then exit(false);
  if x mod 400=0 then exit(True);
  if x mod 100=0 then exit(false);
  exit(true);
end;

Begin
  readln(s1);
  readln(s2);
  Solve;
  for i:=1 to 12 do sum[i]:=sum[i-1]+v[i];
  ans:=0;
  if x1<x2 then
    begin
      ans:=ans+v[y1]-z1+1;
      ans:=ans+sum[12]-sum[y1];
      for i:=x1+1 to x2-1 do
        if  Run(i) then ans:=ans+sum[12]+1
                   else ans:=ans+sum[12];
      ans:=ans+sum[y2-1];
      ans:=ans+z2;
      if Run(x1) then
        begin
         if y1<=2 then inc(ans);
        end;
      if Run(x2) then
        begin
          if (y2>2) then inc(ans);
        end;
    end
           else
    begin
      if y1<y2 then
        begin
          ans:=ans+v[y1]-z1+1;
          ans:=ans+Sum[y2-1]-Sum[y1];
          ans:=ans+z2;
        end
               else
        begin
          ans:=z2-z1+1;
        end;
      if Run(x1) and (y1<=2) then inc(ans);
    end;

  writeln(ans-1);
end.

var
  v:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
  sum:array[0..12] of longint;
  i,j,k,n,m,x1,y1,z1,x2,y2,z2:longint;
  ans:int64;
  s1,s2:string;

Procedure Solve;
var
  k,x:longint;
  s:string;
begin
  if s1>s2 then
    begin
      s:=s1;
      s1:=s2;
      s2:=s;
    end;
  s:=Copy(s1,1,4);
  val(s,x1,x);
  s:=Copy(s1,6,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y1,x);
  s:=Copy(s1,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z1,x);
  s:=Copy(s2,1,4);
  val(s,x2,x);
  s:=Copy(s2,6 ,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y2,x);
  s:=Copy(s2,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z2,x);
end;

Function Run(x:longint):boolean;
begin
  if x mod 4<>0 then exit(false);
  if x mod 400=0 then exit(True);
  if x mod 100=0 then exit(false);
  exit(true);
end;

Begin
  readln(s1);
  readln(s2);
  Solve;
  for i:=1 to 12 do sum[i]:=sum[i-1]+v[i];
  ans:=0;
  if x1<x2 then
    begin
      ans:=ans+v[y1]-z1+1;
      ans:=ans+sum[12]-sum[y1];
      for i:=x1+1 to x2-1 do
        if  Run(i) then ans:=ans+sum[12]+1
                   else ans:=ans+sum[12];
      ans:=ans+sum[y2-1];
      ans:=ans+z2;
    end
           else
    begin
      if y1<y2 then
        begin
          ans:=ans+v[y1]-z1+1;
          ans:=ans+Sum[y2-1]-Sum[y1];
          ans:=ans+z2;
        end
               else
        begin
          ans:=z2-z1+1;
        end;
    end;
  if Run(x1) then
    begin
      if y1<=2 then inc(ans);
    end;
  if Run(x2) then
    begin
      if (y2>2) then inc(ans);
    end;
  writeln(ans-1);
end.

var
  v:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
  sum:array[0..12] of longint;
  i,j,k,n,m,x1,y1,z1,x2,y2,z2:longint;
  ans:int64;
  s1,s2:string;

Procedure Solve;
var
  k,x:longint;
  s:string;
begin
  if s1>s2 then
    begin
      s:=s1;
      s1:=s2;
      s2:=s;
    end;
  s:=Copy(s1,1,4);
  val(s,x1,x);
  s:=Copy(s1,6,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y1,x);
  s:=Copy(s1,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z1,x);
  s:=Copy(s2,1,4);
  val(s,x2,x);
  s:=Copy(s2,6 ,2);
  if s[1]='0' then delete(s,1,1);
  val(s,y2,x);
  s:=Copy(s2,9,2);
  if s[1]='0' then Delete(s,1,1);
  val(s,z2,x);
end;

Function Run(x:longint):boolean;
begin
  if x mod 4<>0 then exit(false);
  if x mod 400=0 then exit(True);
  if x mod 100=0 then exit(false);
  exit(true);
end;

Begin
  readln(s1);
  readln(s2);
  Solve;
  for i:=1 to 12 do sum[i]:=sum[i-1]+v[i];
  ans:=0;
  if x1<x2 then
    begin
      ans:=ans+v[y1]-z1+1;
      ans:=ans+sum[12]-sum[y1];
      for i:=x1+1 to x2-1 do
        if  Run(i) then ans:=ans+sum[12]+1
                   else ans:=ans+sum[12];
      ans:=ans+sum[y2-1];
      ans:=ans+z2;
    end
           else
    begin
      if y1<y2 then
        begin
          ans:=ans+v[y1]-z1+1;
          ans:=ans+Sum[y2-1]-Sum[y1];
          ans:=ans+z2;
        end
               else
        begin
          ans:=z2-z1+1;
        end;
    end;
  if Run(x1) then
    begin
      if y1<=2 then inc(ans);
    end;
  if Run(x2) then
    begin
      if (y2>2) or (y2=2) and (z2=29) then inc(ans);
    end;
  writeln(ans-1);
end.

const f:array[1..12] of longint=(31,59,90,120,151,181,212,243,273,304,334,365);
var sum,y1,m1,d1,y2,m2,d2,i,y:longint;
    d:string;
function pd(x:longint):boolean;
begin
  if x mod 400=0 then
    exit(true);
  if (x mod 100<>0) and (x mod 4=0) then
    exit(true);
  exit(false);
end;
begin
 // assign(input,'rl.in'); reset(input);
 // assign(output,'rl.out'); rewrite(output);
  readln(d);
  val(copy(d,1,4),y1);
  val(copy(d,6,2),m1);
  delete(d,1,8);
  val(d,d1);
  readln(d);
  val(copy(d,1,4),y2);
  val(copy(d,6,2),m2);
  delete(d,1,8);
  val(d,d2);
  if (y1>y2) or ((y1=y2) and (m1>m2)) or ((y1=y2) and (m1=m2) and (d1>d2)) then
    begin
      y:=y1; y1:=y2; y2:=y;
      y:=m1; m1:=m2; m2:=y;
      y:=d1; d1:=d2; d2:=y;
    end;
  if m1 in [1,3,5,7,8,10,12] then
    sum:=31-d1+f[12]-f[m1]
  else if m1 in [4,6,9,11] then
    sum:=30-d1+f[12]-f[m1]
  else
    sum:=28-d1+f[12]-f[m1];
  if pd(y1) and (m1<=2) then
    sum:=sum+1;
  for i:=y1+1 to y2-1 do
    if pd(i) then
      sum:=sum+366
    else
      sum:=sum+365;
  sum:=sum+f[m2-1]+d2;
  if pd(y2) and (m2>2) then
    sum:=sum+1;
  writeln(sum);
  close(input); close(output);
end.

const g:array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var s,s1:string;
    a:array[1..5000] of longint;
    i,j,sum1,sum2,k,l,m,n,y1,y2,m1,m2,d1,d2,q,cod:longint;
begin
  readln(s);
  readln(s1);

 for i:=1 to 2038 do
  if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then a[i]:=1;
  q:=1000;
 for i:=1 to 4 do
  begin
    val(s[i],k,cod);
    val(s1[i],l,cod);
    y1:=y1+k*q;
    y2:=y2+l*q;
    q:=q div 10;
  end;
   q:=10;
   k:=0;
   l:=0;
  for i:=6 to 7 do
   begin
     val(s[i],k,cod);
     val(s1[i],l,cod);
     m1:=m1+k*q;
     m2:=m2+l*q;
     q:=q div 10;
    end;
   q:=10;
   k:=0;
   l:=0;
  for i:=9 to 10 do
   begin
     val(s[i],k,cod);
     val(s1[i],l,cod);
     d1:=d1+k*q;
     d2:=d2+l*q;
     q:=q div 10;
   end;
sum1:=d1;
for i:=m1-1 downto 1 do
sum1:=sum1+g[i];
sum1:=sum1+y1*365;
for i:=1 to y1 do
if a[i]<>0 then inc(sum1);

sum2:=d2;
for i:=m2-1 downto 1 do
sum2:=sum2+g[i];
sum2:=sum2+y2*365;
for i:=1 to y2 do
if a[i]<>0 then inc(sum2);

write(abs(sum1-sum2));
end.

const days :array[1..12]of longint =(31,28,31,30,31,30,31,31,30,31,30,31);
      dayv :array[1..12]of longint =(31,29,31,30,31,30,31,31,30,31,30,31);
var s1,s2,t :string;
    y1,y2,m1,m2,d1,d2,d,m,y :longint;
    ans :int64;
Function vis(a :longint): boolean;
Begin
  if (a mod 400)=0 then exit(true);
  if (a mod 100)=0 then exit(false);
  if (a mod 4)=0 then exit(true);
  exit(false);
end;
Begin
  readln(s1);
  readln(s2);
  if s1>s2 then
  Begin
    t:=s1;
    s1:=s2;
    s2:=t;
  end;
  val(copy(s1,1,4),y1);
  val(copy(s2,1,4),y2);
  val(copy(s1,6,2),m1);
  val(copy(s2,6,2),m2);
  val(copy(s1,9,2),d1);
  val(copy(s2,9,2),d2);
  ans:=0;
  for y:=y1+1 to y2-1 do
    if vis(y) then inc(ans,366) else inc(ans,365);
  for m:=12 downto m1+1 do
    if vis(y1) then inc(ans,dayv[m])
               else inc(ans,days[m]);
  if vis(y1) then
    for d:=dayv[m1] downto d1 do inc(ans)
  else
    for d:=days[m1] downto d1 do inc(ans);
  if vis(y2) then
  Begin
    for m:=1 to m2-1 do inc(ans,dayv[m]);
    inc(ans,d2);
  end else
  Begin
    for m:=1 to m2-1 do inc(ans,days[m]);
    inc(ans,d2);
  end;
  writeln(ans-1);
end.

const days :array[1..12]of longint =(31,28,31,30,31,30,31,31,30,31,30,31);
      dayv :array[1..12]of longint =(31,29,31,30,31,30,31,31,30,31,30,31);
var s1,s2,t :string;
    y1,y2,m1,m2,d1,d2,d,m,y :longint;
    ans :int64;
Function vis(a :longint): boolean;
Begin
  if (a mod 400)=0 then exit(true);
  if (a mod 100)=0 then exit(false);
  if (a mod 4)=0 then exit(true);
  exit(false);
end;
Begin
  readln(s1);
  readln(s2);
  if s1>s2 then
  Begin
    t:=s1;
    s1:=s2;
    s2:=t;
  end;
  val(copy(s1,1,4),y1);
  val(copy(s2,1,4),y2);
  val(copy(s1,6,2),m1);
  val(copy(s2,6,2),m2);
  val(copy(s1,9,2),d1);
  val(copy(s2,9,2),d2);
  if y1=y2 then
  Begin
    ans:=0;
    if vis(y1) then
    Begin
      for m:=m1+1 to m2-1 do
        inc(ans,dayv[m]);
      if m1=m2 then
        inc(ans,d2-d1+1)
      else
      Begin
        inc(ans,dayv[m1]-d1+1);
        inc(ans,d2);
      end;
    end else
    Begin
      for m:=m1+1 to m2-1 do
        inc(ans,days[m]);
      if m1=m2 then
        inc(ans,d2-d1+1)
      else
      Begin
        inc(ans,dayv[m1]-d1+1);
        inc(ans,d2);
      end;
    end;
    writeln(ans-1);
    halt;
  end;
  ans:=0;
  for y:=y1+1 to y2-1 do
    if vis(y) then inc(ans,366) else inc(ans,365);
  for m:=12 downto m1+1 do
    if vis(y1) then inc(ans,dayv[m])
               else inc(ans,days[m]);
  if vis(y1) then
    for d:=dayv[m1] downto d1 do inc(ans)
  else
    for d:=days[m1] downto d1 do inc(ans);
  if vis(y2) then
  Begin
    for m:=1 to m2-1 do inc(ans,dayv[m]);
    inc(ans,d2);
  end else
  Begin
    for m:=1 to m2-1 do inc(ans,days[m]);
    inc(ans,d2);
  end;
  writeln(ans-1);
end.

var
 t,p1,p2,n,m,k,kol,ans,x,y,z:int64;
 sa,sb:string;
 s1,s2,s3:string;
 d:array[1..12] of int64;
 res1,res2,res:int64;
 i,j:longint;

function check(s:string):longint;
var
 s1,s2,s3,sa,sb:string;
 f1,f2,f3:integer;
 ans,c1,c2,c3,x,y,z,p1,p2:int64;
begin
 ans:=0;
 kol:=0;
 for i:=1 to length(s) do if s[i]=':' then
 begin
  inc(kol);
  if kol=1 then p1:=i;
  if kol=2 then p2:=i;
 end;
 s1:=copy(s,1,p1-1);
 s2:=copy(s,p1+1,p2-p1-1);
 s3:=copy(s,p2+1,length(s)-p2);
 val(s1,c1,f1);
 val(s2,c2,f2);
 val(s3,c3,f3);
 for i:=1900 to c1-1 do
 begin
  if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then inc(ans,366) else inc(ans,365);
 end;
 for i:=1 to c2-1 do if ((i=2)and((c1 mod 4=0)and(c1 mod 100<>0))or(c1 mod 400=0)) then inc(ans,d[i]+1) else inc(ans,d[i]);
 inc(ans,c3);
 check:=ans;
end;

begin
 d[1]:=31; d[2]:=28; d[3]:=31; d[4]:=30; d[5]:=31;
 d[6]:=30; d[7]:=31; d[8]:=31; d[9]:=30; d[10]:=31; d[11]:=30;
 d[12]:=31;
{ assign(input,'input.txt');
 reset(input);
 assign(output,'output.txt');
 rewrite(output);   }
 res1:=0;
 res2:=0;
 res:=0;
 readln(sa);
 readln(sb);
 res1:=check(sa);
 res2:=check(sb);
 res:=abs(res2-res1);
 writeln(res);
end.

var
 t,p1,p2,n,m,k,kol,ans,x,y,z:int64;
 sa,sb:string;
 s1,s2,s3:string;
 d:array[1..12] of int64;
 res1,res2,res:int64;
 i,j:longint;

function check(s:string):longint;
var
 s1,s2,s3,sa,sb:string;
 f1,f2,f3:integer;
 ans,c1,c2,c3,x,y,z,p1,p2:int64;
begin
 ans:=0;
 for i:=1 to length(s) do if s[i]=':' then
 begin
  inc(kol);
  if kol=1 then p1:=i;
  if kol=2 then p2:=i;
 end;
 s1:=copy(s,1,p1-1);
 s2:=copy(s,p1+1,p2-p1-1);
 s3:=copy(s,p2+1,length(s)-p2);
 val(s1,c1,f1);
 val(s2,c2,f2);
 val(s3,c3,f3);
 for i:=1900 to c1-1 do
 begin
  if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then inc(ans,366) else inc(ans,365);
 end;
 for i:=1 to c2-1 do if ((i=2)and((c1 mod 4=0)and(c1 mod 100<>0))or(c1 mod 400=0)) then inc(ans,d[i]+1) else inc(ans,d[i]);
 inc(ans,c3);
 check:=ans;
end;

begin
 d[1]:=31; d[2]:=28; d[3]:=31; d[4]:=30; d[5]:=31;
 d[6]:=30; d[7]:=31; d[8]:=31; d[9]:=30; d[10]:=31; d[11]:=30;
 d[12]:=31;
{ assign(input,'input.txt');
 reset(input);
 assign(output,'output.txt');
 rewrite(output);     }
 readln(sa);
 readln(sb);
 res1:=check(sa);
 res2:=check(sb);
 res:=abs(res2-res1);
 writeln(res);
end.

var
 p1,p2,i,j,n,m,k,kol,ans,x,y,z:longint;
 sa,sb:string;
 s1,s2,s3:string;
 d:array[1..12] of longint;
 res1,res2,res:int64;

function check(s:string):longint;
var
 s1,s2,s3,sa,sb:string;
 f1,f2,f3:integer;
 ans,c1,c2,c3,x,y,z,p1,p2:int64;
begin
 ans:=0;
 for i:=1 to length(s) do if s[i]=':' then
 begin
  inc(kol);
  if kol=1 then p1:=i;
  if kol=2 then p2:=i;
 end;
 s1:=copy(s,1,p1-1);
 s2:=copy(s,p1+1,p2-p1-1);
 s3:=copy(s,p2+1,length(s)-p2);
 val(s1,c1,f1);
 val(s2,c2,f2);
 val(s3,c3,f3);
 for i:=1900 to c1-1 do
 begin
  if ((i mod 4=0)and(i mod 100<>0))or(i mod 400=0) then inc(ans,366) else inc(ans,365);
 end;
 for i:=1 to c2-1 do if ((i=2)and((c1 mod 4=0)and(c1 mod 100<>0))or(c1 mod 400=0)) then inc(ans,d[i]+1) else inc(ans,d[i]);
 inc(ans,c3);
 check:=ans;
end;

begin
 d[1]:=31; d[2]:=28; d[3]:=31; d[4]:=30; d[5]:=31;
 d[6]:=30; d[7]:=31; d[8]:=31; d[9]:=30; d[10]:=31; d[11]:=30;
 d[12]:=31;
{ assign(input,'input.txt');
 reset(input);
 assign(output,'output.txt');
 rewrite(output);     }
 readln(sa);
 readln(sb);
 res1:=check(sa);
 res2:=check(sb);
 res:=abs(res2-res1);
 writeln(res);
end.

Program bt2;
Const fi='';
      fo='';
var f1,f2:text;
    a:string;
    nam1,thang1,nam2,x2,y2,thang2,ngay2,ngay1,p,x,y,i,o:integer;
    kq:longint;
Procedure nhap;
begin
        assign(f1,fi);
        assign(f2,fo);
        reset(f1);
        rewrite(f2);
        readln(f1,a);
        nam1:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang1:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay1:=(ord(a[9])-48)*10+(ord(a[10])-48);
        readln(f1,a);
        nam2:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang2:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay2:=(ord(a[9])-48)*10+(ord(a[10])-48);
end;

Procedure xulinam;
begin
        if nam1>nam2 then
        begin
        x:=nam2;
        y:=nam1;
        end
        else
        begin
        x:=nam1;
        y:=nam2;
        end;
        for i:=x+1 to y-1 do
        begin
        if (i mod 4=0) and(i mod 100<>0) then
        kq:=kq+366
        else if(i mod 400)=0 then kq:=kq+366
        else kq:=kq+365;
        end;
end;

Procedure xuli(u:byte);
begin
     for o:=1 to u-1 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
     end;
end;

Procedure xuli3(u:byte);
begin
     for o:=u+1 to 12 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
          else if o=12 then kq:=kq+31;
     end;
end;

Procedure xuli2(u:byte);
begin
     for p:=thang2 to thang1-1 do
         if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30;
end;

Procedure xulingay1(u:byte);
begin
     kq:=kq+u;
end;

Procedure xulingay2(u,l:byte);
begin
o:=l;
if o=1 then o:=31
          else if o=2 then o:=28
          else if o=3 then o:=31
          else if o=4 then o:=30
          else if o=5 then o:=31
          else if o=6 then o:=30
          else if o=7 then o:=31
          else if o=8 then o:=31
          else if o=9 then o:=30
          else if o=10 then o:=31
          else if o=11 then o:=30
          else if o=12 then o:=31;
     kq:=kq+o-u;
end;

Procedure xulingay3;
begin
if ngay1>ngay2 then
kq:=kq+ngay2-ngay1+1
else
kq:=kq+ngay1-ngay2+1;
end;

Procedure xulithang;
begin
if nam1>nam2 then
      begin
        xuli(thang1);
        xuli3(thang2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
else if nam1<nam2 then
      begin
        xuli(thang2);
        xuli3(thang1);
        xulingay1(ngay2);
        xulingay2(ngay1,thang1);
      end
else if nam2=nam1 then if thang1>thang2 then
      begin
        xuli2(thang2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
        else
      begin
        xuli2(thang1);
        if thang1<thang2 then
        begin
        xulingay1(ngay2);
        xulingay2(ngay1,thang1)
        end
        else xulingay3;
      end;
end;

begin
nhap;
kq:=0;
xulinam;
xulithang;
if nam1=nam2 then if (thang1<2) or (thang2<2) then if ((nam1 mod 4=0) and(nam1 mod 100<>0)) or (nam1 mod 400=0) then
   kq:=kq+1;
if nam1>nam2 then
begin
x:=nam1;
x2:=thang1;
y:=nam2;
y2:=thang2;
end
else if nam1<nam2 then
begin
x:=nam2;
x2:=thang2;
y2:=thang1;
y:=nam1;
end;
if nam1<>nam2 then
begin
if ((x mod 4=0) and (x mod 100<>0)) or (x mod 400=0) then if x2>2 then kq:=kq+1;
if ((y mod 4=0) and (y mod 100<>0)) or (y mod 400=0) then if y2<=2 then kq:=kq+1;
end;
writeln(f2,kq);
close(f1);
close(f2);
end.

Program bt2;
Const fi='';
      fo='';
var f1,f2:text;
    a:string;
    nam1,thang1,nam2,x2,y2,thang2,ngay2,ngay1,p,x,y,i,o:integer;
    kq:longint;
Procedure nhap;
begin
        assign(f1,fi);
        assign(f2,fo);
        reset(f1);
        rewrite(f2);
        readln(f1,a);
        nam1:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang1:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay1:=(ord(a[9])-48)*10+(ord(a[10])-48);
        readln(f1,a);
        nam2:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang2:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay2:=(ord(a[9])-48)*10+(ord(a[10])-48);
end;

Procedure xulinam;
begin
        if nam1>nam2 then
        begin
        x:=nam2;
        y:=nam1;
        end
        else
        begin
        x:=nam1;
        y:=nam2;
        end;
        for i:=x+1 to y-1 do
        begin
        if (i mod 4=0) and(i mod 100<>0) then
        kq:=kq+366
        else if(i mod 400)=0 then kq:=kq+366
        else kq:=kq+365;
        end;
end;

Procedure xuli(u:byte);
begin
     for o:=1 to u-1 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
     end;
end;

Procedure xuli3(u:byte);
begin
     for o:=u+1 to 12 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
          else if o=12 then kq:=kq+31;
     end;
end;

Procedure xuli2(u:byte);
var l:byte;
begin
if u=1 then
begin
u:=thang1;
l:=thang2;
end;
if u=2 then
begin
u:=thang2;
l:=thang1;
end;
     for o:=u to l-1 do
         if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30;
end;

Procedure xulingay1(u:byte);
begin
     kq:=kq+u;
end;

Procedure xulingay2(u,l:byte);
begin
o:=l;
if o=1 then o:=31
          else if o=2 then o:=28
          else if o=3 then o:=31
          else if o=4 then o:=30
          else if o=5 then o:=31
          else if o=6 then o:=30
          else if o=7 then o:=31
          else if o=8 then o:=31
          else if o=9 then o:=30
          else if o=10 then o:=31
          else if o=11 then o:=30
          else if o=12 then o:=31;
     kq:=kq+o-u;
end;

Procedure xulingay3;
begin
if ngay1>ngay2 then
kq:=kq+ngay2-ngay1+1
else
kq:=kq+ngay1-ngay2+1;
end;

Procedure xulithang;
begin
if nam1>nam2 then
      begin
        xuli(thang1);
        xuli3(thang2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
else if nam1<nam2 then
      begin
        xuli(thang2);
        xuli3(thang1);
        xulingay1(ngay2);
        xulingay2(ngay1,thang1);
      end
else if nam2=nam1 then if thang1>thang2 then
      begin
        xuli2(2);
        xulingay1(ngay1);
      end
        else
      begin
        if thang1<thang2 then
        xuli2(1);
        if thang1<thang2 then
        begin
        xulingay1(ngay2);
        end
        else xulingay3;
      end;
end;

begin
nhap;
kq:=0;
xulinam;
xulithang;
if nam1=nam2 then if (thang1<2) or (thang2<2) then if ((nam1 mod 4=0) and(nam1 mod 100<>0)) or (nam1 mod 400=0) then
   kq:=kq+1;
if nam1>nam2 then
begin
x:=nam1;
x2:=thang1;
y:=nam2;
y2:=thang2;
end
else if nam1<nam2 then
begin
x:=nam2;
x2:=thang2;
y2:=thang1;
y:=nam1;
end;
if nam1<>nam2 then
begin
if ((x mod 4=0) and (x mod 100<>0)) or (x mod 400=0) then if x2>2 then kq:=kq+1;
if ((y mod 4=0) and (y mod 100<>0)) or (y mod 400=0) then if y2<=2 then kq:=kq+1;
end;
writeln(f2,kq);
close(f1);
close(f2);
end.

Program bt2;
Const fi='';
      fo='';
var f1,f2:text;
    a:string;
    nam1,thang1,nam2,x2,y2,thang2,ngay2,ngay1,p,x,y,i,o:integer;
    kq:longint;
Procedure nhap;
begin
        assign(f1,fi);
        assign(f2,fo);
        reset(f1);
        rewrite(f2);
        readln(f1,a);
        nam1:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang1:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay1:=(ord(a[9])-48)*10+(ord(a[10])-48);
        readln(f1,a);
        nam2:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang2:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay2:=(ord(a[9])-48)*10+(ord(a[10])-48);
end;

Procedure xulinam;
begin
        if nam1>nam2 then
        begin
        x:=nam2;
        y:=nam1;
        end
        else
        begin
        x:=nam1;
        y:=nam2;
        end;
        for i:=x+1 to y-1 do
        begin
        if (i mod 4=0) and(i mod 100<>0) then
        kq:=kq+366
        else if(i mod 400)=0 then kq:=kq+366
        else kq:=kq+365;
        end;
end;

Procedure xuli(u:byte);
begin
     for o:=1 to u-1 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
     end;
end;

Procedure xuli3(u:byte);
begin
     for o:=u+1 to 12 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
          else if o=12 then kq:=kq+31;
     end;
end;

Procedure xuli2(u:byte);
var l:byte;
begin
if u=1 then
begin
u:=thang1;
l:=thang2;
end;
if u=2 then
begin
u:=thang2;
l:=thang1;
end;
     for o:=u+1 to l-1 do
         if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30;
end;

Procedure xulingay1(u:byte);
begin
     kq:=kq+u;
end;

Procedure xulingay2(u,l:byte);
begin
o:=l;
if o=1 then o:=31
          else if o=2 then o:=28
          else if o=3 then o:=31
          else if o=4 then o:=30
          else if o=5 then o:=31
          else if o=6 then o:=30
          else if o=7 then o:=31
          else if o=8 then o:=31
          else if o=9 then o:=30
          else if o=10 then o:=31
          else if o=11 then o:=30
          else if o=12 then o:=31;
     kq:=kq+o-u;
end;

Procedure xulingay3;
begin
if ngay1>ngay2 then
kq:=kq+ngay2-ngay1+1
else
kq:=kq+ngay1-ngay2;
end;

Procedure xulithang;
begin
if nam1>nam2 then
      begin
        xuli(thang1);
        xuli3(thang2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
else if nam1<nam2 then
      begin
        xuli(thang2);
        xuli3(thang1);
        xulingay1(ngay2);
        xulingay2(ngay1,thang1);
      end
else if nam2=nam1 then if thang1>thang2 then
      begin
        xuli2(2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
        else
      begin
        if thang1<thang2 then
        xuli2(1);
        if thang1<thang2 then
        begin
        xulingay1(ngay2);
        xulingay2(ngay1,thang2);
        end
        else xulingay3;
      end;
end;

begin
nhap;
kq:=0;
xulinam;
xulithang;
if nam1=nam2 then if (thang1<=2) or (thang2<=2) then if ((nam1 mod 4=0) and(nam1 mod 100<>0)) or (nam1 mod 400=0) then
   kq:=kq+1;
if nam1>nam2 then
begin
x:=nam1;
x2:=thang1;
y:=nam2;
y2:=thang2;
end
else if nam1<nam2 then
begin
x:=nam2;
x2:=thang2;
y2:=thang1;
y:=nam1;
end;
if nam1<>nam2 then
begin
if ((x mod 4=0) and (x mod 100<>0)) or (x mod 400=0) then if x2>2 then kq:=kq+1;
if ((y mod 4=0) and (y mod 100<>0)) or (y mod 400=0) then if y2<=2 then kq:=kq+1;
end;
writeln(f2,kq);
close(f1);
close(f2);
end.

Program bt2;
Const fi='';
      fo='';
var f1,f2:text;
    a:string;
    nam1,thang1,nam2,x2,y2,thang2,ngay2,ngay1,p,x,y,i,o:integer;
    kq:longint;
Procedure nhap;
begin
        assign(f1,fi);
        assign(f2,fo);
        reset(f1);
        rewrite(f2);
        readln(f1,a);
        nam1:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang1:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay1:=(ord(a[9])-48)*10+(ord(a[10])-48);
        readln(f1,a);
        nam2:=(ord(a[1])-48)*1000+(ord(a[2])-48)*100+(ord(a[3])-48)*10+ord(a[4])-48;
        thang2:=(ord(a[6])-48)*10+(ord(a[7])-48);
        ngay2:=(ord(a[9])-48)*10+(ord(a[10])-48);
end;

Procedure xulinam;
begin
        if nam1>nam2 then
        begin
        x:=nam2;
        y:=nam1;
        end
        else
        begin
        x:=nam1;
        y:=nam2;
        end;
        for i:=x+1 to y-1 do
        begin
        if (i mod 4=0) and(i mod 100<>0) then
        kq:=kq+366
        else if(i mod 400)=0 then kq:=kq+366
        else kq:=kq+365;
        end;
end;

Procedure xuli(u:byte);
begin
     for o:=1 to u-1 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
     end;
end;

Procedure xuli3(u:byte);
begin
     for o:=u+1 to 12 do
     begin
          if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30
          else if o=12 then kq:=kq+31;
     end;
end;

Procedure xuli2(u:byte);
var l:byte;
begin
if u=1 then
begin
u:=thang1;
l:=thang2;
end;
if u=2 then
begin
u:=thang2;
l:=thang1;
end;
     for o:=u+1 to l-1 do
         if o=1 then kq:=kq+31
          else if o=2 then kq:=kq+28
          else if o=3 then kq:=kq+31
          else if o=4 then kq:=kq+30
          else if o=5 then kq:=kq+31
          else if o=6 then kq:=kq+30
          else if o=7 then kq:=kq+31
          else if o=8 then kq:=kq+31
          else if o=9 then kq:=kq+30
          else if o=10 then kq:=kq+31
          else if o=11 then kq:=kq+30;
end;

Procedure xulingay1(u:byte);
begin
     kq:=kq+u;
end;

Procedure xulingay2(u,l:byte);
begin
o:=l;
if o=1 then o:=31
          else if o=2 then o:=28
          else if o=3 then o:=31
          else if o=4 then o:=30
          else if o=5 then o:=31
          else if o=6 then o:=30
          else if o=7 then o:=31
          else if o=8 then o:=31
          else if o=9 then o:=30
          else if o=10 then o:=31
          else if o=11 then o:=30
          else if o=12 then o:=31;
     kq:=kq+o-u;
end;

Procedure xulingay3;
begin
if ngay1>ngay2 then
kq:=kq+ngay2-ngay1+1
else
kq:=kq+ngay1-ngay2+1;
end;

Procedure xulithang;
begin
if nam1>nam2 then
      begin
        xuli(thang1);
        xuli3(thang2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
else if nam1<nam2 then
      begin
        xuli(thang2);
        xuli3(thang1);
        xulingay1(ngay2);
        xulingay2(ngay1,thang1);
      end
else if nam2=nam1 then if thang1>thang2 then
      begin
        xuli2(2);
        xulingay1(ngay1);
        xulingay2(ngay2,thang2);
      end
        else
      begin
        if thang1<thang2 then
        xuli2(1);
        if thang1<thang2 then
        begin
        xulingay1(ngay2);
        xulingay2(ngay1,thang2);
        end
        else xulingay3;
      end;
end;

begin
nhap;
kq:=0;
xulinam;
xulithang;
if nam1=nam2 then if (thang1<=2) or (thang2<=2) then if ((nam1 mod 4=0) and(nam1 mod 100<>0)) or (nam1 mod 400=0) then
   kq:=kq+1;
if nam1>nam2 then
begin
x:=nam1;
x2:=thang1;
y:=nam2;
y2:=thang2;
end
else if nam1<nam2 then
begin
x:=nam2;
x2:=thang2;
y2:=thang1;
y:=nam1;
end;
if nam1<>nam2 then
begin
if ((x mod 4=0) and (x mod 100<>0)) or (x mod 400=0) then if x2>2 then kq:=kq+1;
if ((y mod 4=0) and (y mod 100<>0)) or (y mod 400=0) then if y2<=2 then kq:=kq+1;
end;
writeln(f2,kq);
close(f1);
close(f2);
end.

Const
        thang:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
Type
        mat=array [1..1000000] of longint;
Var     n,res,y1,d1,m1,y2,d2,m2:longint;
        a,s:string;
        fi,fo:text;

Procedure Doc;
        Begin
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y1);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m1);
                Val(a,d1);
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y2);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m2);
                Val(a,d2);
        end;

Procedure Doicho(Var x,y:longint);
        Var tg:longint;
        Begin
                tg:=x;
                x:=y;
                y:=tg;
        end;

Function Nhuan(x:longint):boolean;
        Begin
                If ((x mod 4=0) and (x mod 100<>0)) or ( x mod 400=0) then
                 exit(true);
                exit(false);
        end;

Procedure Lam;
        Var i:longint;
        Begin
                 If y1>y2 then
                  Begin
                        Doicho(y1,y2);
                        Doicho(m1,m2);
                        Doicho(d1,d2);
                  end;
                 res:=0;
                 For i:=y1+1 to y2-1 do
                  If Nhuan(i) then
                   res:=res+366
                  else res:=res+365;
                 If y1=y2 then
                  Begin
                        For i:=m1+1 to m2-1 do res:=res+thang[i];
                        If (m1<=2) and (m2>=2) then inc(res);
                        If m1<>m2 then
                          res:=res+thang[m1]-d1+d2
                        else res:=res+d2-d1+1;
                  end
                 else
                  Begin
                   For i:=m1+1 to 12 do res:=res+thang[i];
                 If Nhuan(y1) then
                   If m1<=2 then inc(res);
                 For i:= 1 to m2-1 do res:=res+thang[i];
                 If Nhuan(y2) then
                   If m2>2 then inc(res);
                 res:=res+thang[m1]-d1+d2;
                 end;
                Write(fo,res);
        end;

Procedure Inkq;
        Begin
        end;

        Begin
                Assign(fi,'');Reset(fi);
                Assign(fo,'');Rewrite(fo);
                        Doc;
                        Lam;
                        Inkq;
                Close(fo);Close(fi);
        end.

Const
        thang:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
Type
        mat=array [1..1000000] of longint;
Var     n,res,y1,d1,m1,y2,d2,m2:longint;
        a,s:string;
        fi,fo:text;

Procedure Doc;
        Begin
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y1);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m1);
                Val(a,d1);
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y2);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m2);
                Val(a,d2);
        end;

Procedure Doicho(Var x,y:longint);
        Var tg:longint;
        Begin
                tg:=x;
                x:=y;
                y:=tg;
        end;

Function Nhuan(x:longint):boolean;
        Begin
                If ((x mod 4=0) and (x mod 100<>0)) or ( x mod 400=0) then
                 exit(true);
                exit(false);
        end;

Procedure Lam;
        Var i:longint;
        Begin
                 If y1>y2 then
                  Begin
                        Doicho(y1,y2);
                        Doicho(m1,m2);
                        Doicho(d1,d2);
                  end;
                 res:=0;
                 For i:=y1+1 to y2-1 do
                  If Nhuan(i) then
                   res:=res+366
                  else res:=res+365;
                 If y1=y2 then
                  Begin
                        For i:=m1+1 to m2-1 do res:=res+thang[i];
                        If (m1<=2) and (m2>2) then inc(res);
                        If m1<>m2 then
                          res:=res+thang[m1]-d1+d2
                        else res:=res+d2-d1;
                  end
                 else
                  Begin
                   For i:=m1+1 to 12 do res:=res+thang[i];
                 If Nhuan(y1) then
                   If m1<=2 then inc(res);
                 For i:= 1 to m2-1 do res:=res+thang[i];
                 If Nhuan(y2) then
                   If m2>2 then inc(res);
                 res:=res+thang[m1]-d1+d2;
                 end;
                Write(fo,res);
        end;

Procedure Inkq;
        Begin
        end;

        Begin
                Assign(fi,'');Reset(fi);
                Assign(fo,'');Rewrite(fo);
                        Doc;
                        Lam;
                        Inkq;
                Close(fo);Close(fi);
        end.

Const
        thang:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
Type
        mat=array [1..1000000] of longint;
Var     n,res,y1,d1,m1,y2,d2,m2:longint;
        a,s:string;
        fi,fo:text;

Procedure Doc;
        Begin
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y1);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m1);
                Val(a,d1);
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y2);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m2);
                Val(a,d2);
        end;

Procedure Doicho(Var x,y:longint);
        Var tg:longint;
        Begin
                tg:=x;
                x:=y;
                y:=tg;
        end;

Function Nhuan(x:longint):boolean;
        Begin
                If ((x mod 4=0) and (x mod 100<>0)) or ( x mod 400=0) then
                 exit(true);
                exit(false);
        end;

Procedure Lam;
        Var i:longint;
        Begin
                 If y1>y2 then
                  Begin
                        Doicho(y1,y2);
                        Doicho(m1,m2);
                        Doicho(d1,d2);
                  end;
                 res:=0;
                 For i:=y1+1 to y2-1 do
                  If Nhuan(i) then
                   res:=res+366
                  else res:=res+365;
                 If y1=y2 then
                  Begin
                        For i:=m1+1 to m2-1 do res:=res+thang[i];
                        If (m1<=2) and (m2>=2) then inc(res);
                        If m1<>m2 then
                          res:=res+thang[m1]-d1+d2
                        else res:=res+d2-d1;
                  end
                 else
                  Begin
                   For i:=m1+1 to 12 do res:=res+thang[i];
                 If Nhuan(y1) then
                   If m1<=2 then inc(res);
                 For i:= 1 to m2-1 do res:=res+thang[i];
                 If Nhuan(y2) then
                   If m2>2 then inc(res);
                 res:=res+thang[m1]-d1+d2;
                 end;
                Write(fo,res);
        end;

Procedure Inkq;
        Begin
        end;

        Begin
                Assign(fi,'');Reset(fi);
                Assign(fo,'');Rewrite(fo);
                        Doc;
                        Lam;
                        Inkq;
                Close(fo);Close(fi);
        end.

Const
        thang:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
Type
        mat=array [1..1000000] of longint;
Var     n,res,y1,d1,m1,y2,d2,m2:longint;
        a,s:string;
        fi,fo:text;

Procedure Doc;
        Begin
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y1);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m1);
                Val(a,d1);
                Readln(fi,a);
                s:='';
                s:=a[1]+a[2]+a[3]+a[4];
                Delete(a,1,5);
                Val(s,y2);
                s:='';
                s:=a[1]+a[2];
                Delete(a,1,3);
                Val(s,m2);
                Val(a,d2);
        end;

Procedure Doicho(Var x,y:longint);
        Var tg:longint;
        Begin
                tg:=x;
                x:=y;
                y:=tg;
        end;

Function Nhuan(x:longint):boolean;
        Begin
                If ((x mod 4=0) and (x mod 100<>0)) or ( x mod 400=0) then
                 exit(true);
                exit(false);
        end;

Procedure Lam;
        Var i:longint;
        Begin
                 If y1>y2 then
                  Begin
                        Doicho(y1,y2);
                        Doicho(m1,m2);
                        Doicho(d1,d2);
                  end;
                 res:=0;
                 For i:=y1+1 to y2-1 do
                  If Nhuan(i) then
                   res:=res+366
                  else res:=res+365;
                 If y1=y2 then
                  Begin
                        For i:=m1+1 to m2-1 do res:=res+thang[i];
                        If (m1<=2) and (m2>=2) then inc(res);
                        If m1<>m2 then
                          res:=res+thang[m1]-d1+d2
                        else res:=res+d2-d1+1;
                  end
                 else
                  Begin
                   For i:=m1+1 to 12 do res:=res+thang[i];
                 If Nhuan(y1) then
                   If m1<=2 then inc(res);
                 For i:= 1 to m2-1 do res:=res+thang[i];
                 If Nhuan(y2) then
                   If m2>=2 then inc(res);
                 res:=res+thang[m1]-d1+d2;
                 end;
                Write(fo,res);
        end;

Procedure Inkq;
        Begin
        end;

        Begin
                Assign(fi,'');Reset(fi);
                Assign(fo,'');Rewrite(fo);
                        Doc;
                        Lam;
                        Inkq;
                Close(fo);Close(fi);
        end.

var prim,doi,an_1,luna_1,zi_1,an_2,luna_2,zi_2:string;
    an1,luna1,zi1,an2,luna2,zi2,cod,i:integer;
    raspuns,q,w,z,s:longint;
    an:1900..2038;
    luna:1..12;
    zi:1..31;
begin
    readln(prim);
    readln(doi);
    an_1:=copy(prim,1,4);
    luna_1:=copy(prim,6,2);
    zi_1:=copy(prim,9,2);
    an_2:=copy(doi,1,4);
    luna_2:=copy(doi,6,2);
    zi_2:=copy(doi,9,2);
    val(an_1,an1,cod);
    val(an_2,an2,cod);
    val(luna_1,luna1,cod);
    val(luna_2,luna2,cod);
    val(zi_1,zi1,cod);
    val(zi_2,zi2,cod);
    for i:=1900 to an1 do
    begin
    if (i mod 4=0)and(i mod 100<>0)and(i mod 400<>0)then q:=q+366
    else
    if (i mod 100=0)and(i mod 400=0)then q:=q+366
    else q:=q+365;
    end;
    if (an1 mod 4=0)and(an1 mod 100<>0)and(an1 mod 400<>0)then  z:=29
                   else
                   if (an1 mod 100=0)and(an1 mod 400=0)then  z:=29
                   else  z:=28;
    if luna1=1 then s:=s+zi1;
    if luna1=2 then s:=s+31+zi1;
    if luna1=3 then s:=s+31+zi1+z;
    if luna1=4 then s:=s+62+zi1+z;
    if luna1=5 then s:=s+92+zi1+z;
    if luna1=6 then s:=s+123+zi1+z;
    if luna1=7 then s:=s+153+zi1+z;
    if luna1=8 then s:=s+184+zi1+z;
    if luna1=9 then s:=s+215+zi1+z;
    if luna1=10 then s:=s+245+zi1+z;
    if luna1=11 then s:=s+276+zi1+z;
    if luna1=12 then s:=s+306+zi1+z;
    q:=q+s;
    if an1=1900 then q:=s+365;
    if an1=2038 then q:=q-365;
    s:=0;z:=0;
    for i:=1900 to an2 do
    begin
    if (i mod 4=0)and(i mod 100<>0)and(i mod 400<>0)then w:=w+366
    else
    if (i mod 100=0)and(i mod 400=0)then w:=w+366
    else w:=w+365;
    end;
    if (an2 mod 4=0)and(an2 mod 100<>0)and(an2 mod 400<>0)then  z:=29
                   else
                   if (an2 mod 100=0)and(an2 mod 400=0)then  z:=29
                   else z:=28;
    if luna2=1 then s:=s+zi2;
    if luna2=2 then s:=s+31+zi2;
    if luna2=3 then s:=s+31+zi2+z;
    if luna2=4 then s:=s+62+zi2+z;
    if luna2=5 then s:=s+92+zi2+z;
    if luna2=6 then s:=s+123+zi2+z;
    if luna2=7 then s:=s+153+zi2+z;
    if luna2=8 then s:=s+184+zi2+z;
    if luna2=9 then s:=s+215+zi2+z;
    if luna2=10 then s:=s+245+zi2+z;
    if luna2=11 then s:=s+276+zi2+z;
    if luna2=12 then s:=s+306+zi2+z;
    w:=w+s;
    if an2=1900 then w:=s+365;
    if an2=2038 then w:=w-365;
    if (an1 mod 4=0)and(an1 mod 100<>0)and(an1 mod 400<>0)then q:=q-366
    else
    if (an1 mod 100=0)and(an1 mod 400=0)then q:=q-366
    else q:=q-365;
    if (an2 mod 4=0)and(an2 mod 100<>0)and(an2 mod 400<>0)then w:=w-366
    else
    if (an2 mod 100=0)and(an2 mod 400=0)then w:=w-366
    else w:=w-365;
    writeln('Q->',q);
    writeln('W->',w);
    raspuns:=abs(q-w);
    writeln(Raspuns);
end.

var prim,doi,an_1,luna_1,zi_1,an_2,luna_2,zi_2:string;
    an1,luna1,zi1,an2,luna2,zi2,cod,i:integer;
    raspuns,q,w,z,s:longint;
    an:1900..2038;
    luna:1..12;
    zi:1..31;
begin
    readln(prim);
    readln(doi);
    an_1:=copy(prim,1,4);
    luna_1:=copy(prim,6,2);
    zi_1:=copy(prim,9,2);
    an_2:=copy(doi,1,4);
    luna_2:=copy(doi,6,2);
    zi_2:=copy(doi,9,2);
    val(an_1,an1,cod);
    val(an_2,an2,cod);
    val(luna_1,luna1,cod);
    val(luna_2,luna2,cod);
    val(zi_1,zi1,cod);
    val(zi_2,zi2,cod);
    for i:=1900 to an1 do
    begin
    if (i mod 4=0)and(i mod 100<>0)and(i mod 400<>0)then q:=q+366
    else
    if (i mod 100=0)and(i mod 400=0)then q:=q+366
    else q:=q+365;
    end;
    if (an1 mod 4=0)and(an1 mod 100<>0)and(an1 mod 400<>0)then  z:=29
                   else
                   if (an1 mod 100=0)and(an1 mod 400=0)then  z:=29
                   else  z:=28;
    if luna1=1 then s:=s+zi1;
    if luna1=2 then s:=s+31+zi1;
    if luna1=3 then s:=s+31+zi1+z;
    if luna1=4 then s:=s+62+zi1+z;
    if luna1=5 then s:=s+92+zi1+z;
    if luna1=6 then s:=s+123+zi1+z;
    if luna1=7 then s:=s+153+zi1+z;
    if luna1=8 then s:=s+184+zi1+z;
    if luna1=9 then s:=s+215+zi1+z;
    if luna1=10 then s:=s+245+zi1+z;
    if luna1=11 then s:=s+276+zi1+z;
    if luna1=12 then s:=s+306+zi1+z;
    q:=q+s;
    if an1=1900 then q:=s;
    if an1=2038 then q:=q-365;
    s:=0;z:=0;
    for i:=1900 to an2 do
    begin
    if (i mod 4=0)and(i mod 100<>0)and(i mod 400<>0)then w:=w+366
    else
    if (i mod 100=0)and(i mod 400=0)then w:=w+366
    else w:=w+365;
    end;
    if (an2 mod 4=0)and(an2 mod 100<>0)and(an2 mod 400<>0)then  z:=29
                   else
                   if (an2 mod 100=0)and(an2 mod 400=0)then  z:=29
                   else z:=28;
    if luna2=1 then s:=s+zi2;
    if luna2=2 then s:=s+31+zi2;
    if luna2=3 then s:=s+31+zi2+z;
    if luna2=4 then s:=s+62+zi2+z;
    if luna2=5 then s:=s+92+zi2+z;
    if luna2=6 then s:=s+123+zi2+z;
    if luna2=7 then s:=s+153+zi2+z;
    if luna2=8 then s:=s+184+zi2+z;
    if luna2=9 then s:=s+215+zi2+z;
    if luna2=10 then s:=s+245+zi2+z;
    if luna2=11 then s:=s+276+zi2+z;
    if luna2=12 then s:=s+306+zi2+z;
    w:=w+s;
    if an2=1900 then w:=s;
    if an2=2038 then w:=w-365;
    if (an1 mod 4=0)and(an1 mod 100<>0)and(an1 mod 400<>0)then q:=q-366
    else
    if (an1 mod 100=0)and(an1 mod 400=0)then q:=q-366
    else q:=q-365;
    if (an2 mod 4=0)and(an2 mod 100<>0)and(an2 mod 400<>0)then w:=w-366
    else
    if (an2 mod 100=0)and(an2 mod 400=0)then w:=w-366
    else w:=w-365;
    raspuns:=abs(q-w);
    writeln(Raspuns);
end.

var     y1, y2, m1, m2, d1, d2, year : integer;
        kq, k1, k2 : longint;
        c1, c2 : char;
        i, j : integer;
        f2 : text;
        s1, s2 : string;
const   day : array[1..12] of integer
        = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function songay(x : integer) : integer;
        begin
                if x mod 400 = 0 then exit(366);
                if x mod 4 = 0 then exit(366);
                exit(365);
        end;
function kt(x : integer) : boolean;
        begin
                if x mod 400 = 0 then exit(true);
                if x mod 4 = 0 then exit(true);
                exit(false);
        end;
begin
        readln(s1);
        readln(s2);
        for i := 1 to length(s1) do
                begin
                if s1[i] = ':' then s1[i] := ' ';
                if s2[i] = ':' then s2[i] := ' ';
                end;
        assign(f2, 'test.txt'); rewrite(f2);
        writeln(f2, s1);
        writeln(f2, s2);
        close(f2);
        reset(f2);
        readln(f2, y1, m1, d1);
        readln(f2, y2, m2, d2);
        close(f2);
        if y1 < y2 then year := y1 else year := y2;
        {---}
        k1 := d1;
        if kt(y1) then
                begin
                  if m1 > 2 then inc(k1)
                  else
                        if (d1=29) and (m1=2) then inc(k1);
                end;
        for i := 1 to m1 - 1 do
                k1 := k1 + day[i];
        for i := year to y1 - 1 do
                k1 := k1 + songay(i);
        // -----
        k2 := d2;
        if kt(y2) then
                begin
                  if m2 > 2 then inc(k2)
                  else
                        if (d2=29) and (m2=2) then inc(k2);
                end;
        for i := 1 to m2 - 1 do
                k2  := k2 + day[i];
        for i := year to y2 - 1 do
                k2 := k2 + songay(i);
        writeln(abs(k1-k2) - 1);
end.

var     y1, y2, m1, m2, d1, d2, year : integer;
        kq, k1, k2 : longint;
        c1, c2 : char;
        i, j : integer;
        f2 : text;
        s1, s2 : string;
const   day : array[1..12] of integer
        = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function songay(x : integer) : integer;
        begin
                if x mod 400 = 0 then exit(366);
                if x mod 100 = 0 then exit(365);
                if x mod 4 = 0 then exit(366);
                exit(365);
        end;
function kt(x : integer) : boolean;
        begin
                if x mod 400 = 0 then exit(true);
                if x mod 100 = 0 then exit(false);
                if x mod 4 = 0 then exit(true);
                exit(false);
        end;
begin
        readln(s1);
        readln(s2);
        for i := 1 to length(s1) do
                begin
                if s1[i] = ':' then s1[i] := ' ';
                if s2[i] = ':' then s2[i] := ' ';
                end;
        assign(f2, 'test.txt'); rewrite(f2);
        writeln(f2, s1);
        writeln(f2, s2);
        close(f2);
        reset(f2);
        readln(f2, y1, m1, d1);
        readln(f2, y2, m2, d2);
        close(f2);
        if y1 < y2 then year := y1 else year := y2;
        {---}
        k1 := d1;
        if kt(y1) then
                begin
                  if m1 > 2 then inc(k1)
                  else
                        if (d1=29) and (m1=2) then inc(k1);
                end;
        for i := 1 to m1 - 1 do
                k1 := k1 + day[i];
        for i := year to y1 - 1 do
                k1 := k1 + songay(i);
        // -----
        k2 := d2;
        if kt(y2) then
                begin
                  if m2 > 2 then inc(k2)
                  else
                        if (d2=29) and (m2=2) then inc(k2);
                end;
        for i := 1 to m2 - 1 do
                k2  := k2 + day[i];
        for i := year to y2 - 1 do
                k2 := k2 + songay(i);
        writeln(abs(k1-k2) );
end.

const   fi = '';
        fo = '';
var     f,g:text;
        s1,s2:string;

procedure openfile;
begin
        assign(f,fi);reset(f);
        assign(g,fo);rewrite(g);
end;
procedure readfile;
begin
        readln(f,s1);
        readln(f,s2);
end;
function sn(i:integer;k:boolean):integer;
begin
        case i of
                1,3,5,7,8,10,12:sn:=31;
                4,6,9,11:sn:=30;
                2:if k then sn:=29
                else sn:=28;
        end;
end;
function tinh(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:= b+1 to 12 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+sn(b,kt)-c;
        tinh:=t;

end;
function tinh1(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:=1 to b-1 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+c;
        tinh1:=t;
end;
procedure swap(var a,b:longint);
var     tg:longint;
begin
        tg:=a;
        a:=b;
        b:=tg;
end;
procedure process;
var     t,b,dem,i,vt,k,a1,b1,c1,a2,b2,c2:longint;
        kq:int64;
begin
        kq:=0;
        k:=pos(':',s1);
        val(copy(s1,1,k-1),a1);
        delete(s1,1,k);
        k:=pos(':',s1);
        val(copy(s1,1,k-1),b1);
        delete(s1,1,k);
        val(s1,c1);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),a2);
        delete(s2,1,k);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),b2);
        delete(s2,1,k);
        val(s2,c2);
        if a1>a2 then
                begin
                        swap(a1,a2);
                        swap(b1,b2);
                        swap(c1,c2);
                end;
        for i:=a1+1 to a2-1 do
                if (i mod 4=0) then
                        begin
                        kq:=kq+366;
                        if (i mod 100=0) and (i mod 400<>0) then kq:=kq-1;
                        end
                else kq:=kq+365;
        kq:=kq+tinh(a1,b1,c1)+tinh1(a2,b2,c2);
        writeln(g,kq);
end;
procedure closefile;
begin
        close(f);
        close(g);
end;
begin
        openfile;
        readfile;
        process;
        closefile;
end.

const   fi = '';
        fo = '';
var     f,g:text;
        s1,s2:string;

procedure openfile;
begin
        assign(f,fi);reset(f);
        assign(g,fo);rewrite(g);
end;
procedure readfile;
begin
        readln(f,s1);
        readln(f,s2);
end;
function sn(i:integer;k:boolean):integer;
begin
        case i of
                1,3,5,7,8,10,12:sn:=31;
                4,6,9,11:sn:=30;
                2:if k then sn:=29
                else sn:=28;
        end;
end;
function tinh(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:= b+1 to 12 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+sn(b,kt)-c;
        tinh:=t;

end;
function tinh1(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:=1 to b-1 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+c;
        tinh1:=t;
end;
procedure swap(var a,b:longint);
var     tg:longint;
begin
        tg:=a;
        a:=b;
        b:=tg;
end;
procedure process;
var     t,b,dem,i,vt,k,a1,b1,c1,a2,b2,c2:longint;
        kq:int64;
        kt:boolean;
begin
        kq:=0;
        k:=pos(':',s1);
        val(copy(s1,1,k-1),a1);
        delete(s1,1,k);
        k:=pos(':',s1);
        val(copy(s1,1,k-1),b1);
        delete(s1,1,k);
        val(s1,c1);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),a2);
        delete(s2,1,k);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),b2);
        delete(s2,1,k);
        val(s2,c2);
        if a1=a2 then
                begin
                        if a1 mod 4=0 then
                                begin
                                        kt:=true;
                                        if (a1 mod 100=0) and (a1  mod 400=0) then kt:=false;
                                end
                        else kt:=false;
                        if b1>b2 then
                                begin
                                        swap(b1,b2);
                                        swap(c1,c2);
                                end;
                        for i:=b1+1 to b2-1 do
                                kq:=kq+sn(i,kt);
                        if b1=b2 then
                                begin
                                        kq:=abs(c1-c2)+1;
                                end
                        else kq:=kq+sn(b1,kt)-c1+c2;
                end
        else
        begin
        if a1>a2 then
                begin
                        swap(a1,a2);
                        swap(b1,b2);
                        swap(c1,c2);
                end;
        for i:=a1+1 to a2-1 do
                if (i mod 4=0) then
                        begin
                        kq:=kq+366;
                        if (i mod 100=0) and (i mod 400<>0) then kq:=kq-1;
                        end
                else kq:=kq+365;
        kq:=kq+tinh(a1,b1,c1)+tinh1(a2,b2,c2);
        end;
        writeln(g,kq);
end;
procedure closefile;
begin
        close(f);
        close(g);
end;
begin
        openfile;
        readfile;
        process;
        closefile;
end.

const   fi = '';
        fo = '';
var     f,g:text;
        s1,s2:string;

procedure openfile;
begin
        assign(f,fi);reset(f);
        assign(g,fo);rewrite(g);
end;
procedure readfile;
begin
        readln(f,s1);
        readln(f,s2);
end;
function sn(i:integer;k:boolean):integer;
begin
        case i of
                1,3,5,7,8,10,12:sn:=31;
                4,6,9,11:sn:=30;
                2:if k then sn:=29
                else sn:=28;
        end;
end;
function tinh(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400=0)) then kt:=false;
                end
        else kt:=false;
        for i:= b+1 to 12 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+sn(i,kt)-c;
        tinh:=t;

end;
function tinh1(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400=0)) then kt:=false;
                end
        else kt:=false;
        for i:=1 to b-1 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+c;
        tinh1:=t;
end;
procedure process;
var     t,b,dem,i,vt,k,a1,b1,c1,a2,b2,c2:longint;
        kq:int64;
begin
        kq:=0;
        k:=pos(':',s1);
        val(copy(s1,1,k-1),a1);
        delete(s1,1,k);
        k:=pos(':',s1);
        val(copy(s1,1,k-1),b1);
        delete(s1,1,k);
        val(s1,c1);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),a2);
        delete(s2,1,k);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),b2);
        delete(s2,1,k);
        val(s2,c2);
        vt:=2000;
        dem:=0;
        for i:=a1+1 to a2-1 do
                if (i mod 4=0) then
                        begin
                        kq:=kq+366;
                        if (i mod 100=0) and (i mod 400=0) then kq:=kq-1;
                        end
                else kq:=kq+365;
        kq:=kq+tinh(a1,b1,c1)+tinh1(a2,b2,c2);
        writeln(g,kq);
end;
procedure closefile;
begin
        close(f);
        close(g);
end;
begin
        openfile;
        readfile;
        process;
        closefile;
end.

const   fi = '';
        fo = '';
var     f,g:text;
        s1,s2:string;

procedure openfile;
begin
        assign(f,fi);reset(f);
        assign(g,fo);rewrite(g);
end;
procedure readfile;
begin
        readln(f,s1);
        readln(f,s2);
end;
function sn(i:integer;k:boolean):integer;
begin
        case i of
                1,3,5,7,8,10,12:sn:=31;
                4,6,9,11:sn:=30;
                2:if k then sn:=29
                else sn:=28;
        end;
end;
function tinh(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:= b+1 to 12 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+sn(i,kt)-c;
        tinh:=t;

end;
function tinh1(a,b,c:longint):longint;
var     t,i:longint;
        kt:boolean;
begin
        t:=0;
        if (a mod 4=0) then
                begin
                        kt:=true;
                        if ((a mod 100=0) and (a mod 400<>0)) then kt:=false;
                end
        else kt:=false;
        for i:=1 to b-1 do
                begin
                        t:=t+sn(i,kt);
                end;
        t:=t+c;
        tinh1:=t;
end;
procedure swap(var a,b:longint);
var     tg:longint;
begin
        tg:=a;
        a:=b;
        b:=tg;
end;
procedure process;
var     t,b,dem,i,vt,k,a1,b1,c1,a2,b2,c2:longint;
        kq:int64;
begin
        kq:=0;
        k:=pos(':',s1);
        val(copy(s1,1,k-1),a1);
        delete(s1,1,k);
        k:=pos(':',s1);
        val(copy(s1,1,k-1),b1);
        delete(s1,1,k);
        val(s1,c1);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),a2);
        delete(s2,1,k);
        k:=pos(':',s2);
        val(copy(s2,1,k-1),b2);
        delete(s2,1,k);
        val(s2,c2);
        if a1>a2 then
                begin
                        swap(a1,a2);
                        swap(b1,b2);
                        swap(c1,c2);
                end;
        vt:=2000;
        dem:=0;
        for i:=a1+1 to a2-1 do
                if (i mod 4=0) then
                        begin
                        kq:=kq+366;
                        if (i mod 100=0) and (i mod 400<>0) then kq:=kq-1;
                        end
                else kq:=kq+365;
        kq:=kq+tinh(a1,b1,c1)+tinh1(a2,b2,c2);
        writeln(g,kq);
end;
procedure closefile;
begin
        close(f);
        close(g);
end;
begin
        openfile;
        readfile;
        process;
        closefile;
end.

Program B183;
Var
  con:Array[1..12] Of Longint=(31,28,31,30,31,30,31,31,30,31,30,31);
  sum:Array[0..12] OF Longint;
  s1,s2,nian,yue,ri:String;
  nian1,nian2,yue1,yue2,ri1,ri2,ans,i,n:Longint;
  flag:Boolean;
Begin
  For i:=1 To 12 Do sum[i]:=sum[i-1]+con[i];
  Readln(s1);
  Readln(s2);
  If s1>s2 Then Begin
    nian:=s1;
    s1:=s2;
    s2:=nian;
  End;
  nian:=Copy(s1,1,4);
  Val(nian,nian1);
  yue:=Copy(s1,6,2);
  Val(yue,yue1);
  ri:=Copy(s1,9,2);
  Val(ri,ri1);
  nian:=Copy(s2,1,4);
  Val(nian,nian2);
  yue:=Copy(s2,6,2);
  Val(yue,yue2);
  ri:=Copy(s2,9,2);
  Val(ri,ri2);
  flag:=True;
  If (nian1 Mod 100=0) Then Begin
    If nian1 Mod 400<>0 Then flag:=False;
  End Else If nian1 Mod 4<>0 Then flag:=FAlse;
  ans:=ans+sum[12]-sum[yue1];
  ans:=ans+con[yue1]-ri1;
  If (yue1<=2)And(flag) Then Inc(ans);
  For i:=nian1+1 To nian2-1 Do Begin
    ans:=ans+sum[12];
    flag:=True;
    If (i Mod 100=0) Then Begin
      If i Mod 400<>0 Then flag:=False;
    End Else If i Mod 4<>0 Then flag:=False;
    If flag Then Inc(ans);
  End;
  ans:=ans+sum[yue2-1]+ri2;
  flag:=True;
  If (nian2 Mod 100=0) Then Begin
    If nian2 Mod 400<>0 Then flag:=FAlse;
  End Else If nian2 Mod 4<>0 Then flag:=False;
  If (yue2>=3) Then inc(ans);
  ans:=ans-1;
  If nian1=nian2 Then Begin
    ans:=ans-365;
    If flag Then ans:=ans-1;
  End;
  Writeln(ans);
End.

const a:array[1..12]of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var x,y,i,j,all:longint;
    s:string;
function f(s:string):longint;
var i,x,n,k,y,m,d:longint;
 begin
  n:=length(s);
  k:=0;y:=0;m:=0;d:=0;x:=0;
  for i:=1 to n do
   if(s[i]=':')then inc(k)
   else
   if(k=0)then y:=y*10+ord(s[i])-48
   else
   if(k=1)then m:=m*10+ord(s[i])-48
   else
   if(k=2)then d:=d*10+ord(s[i])-48;
   for i:=1 to y-1 do
    if((i mod 4=0)and(i mod 100<>0))or(i mod 400=0)then x:=x+all+1 else x:=x+all;
   for i:=1 to m-1 do
    begin
     x:=x+a[i];
     if(i=2)and(((i mod 4=0)and(i mod 100<>0))or(i mod 400=0))then x:=x+1;
    end;
   x:=x+d;
   exit(x);
  end;
 begin
  for i:=1 to 12 do
   all:=all+a[i];
  readln(s);
  x:=f(s);
  readln(s);
  y:=f(s);
  writeln(abs(y-x)+1);
 end.

program uio;
const month:array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
 var  s1,s2:string;
      y1,m1,d1,y2,m2,d2,kol,i:longint;

procedure pro(s:string; var y,m,d:longint);
 var code:longint;
     ss:string;

begin

 ss:=s[1]+s[2]+s[3]+s[4];
 val(ss,y,code);

 ss:='';
 if s[6]='0' then ss:=ss+s[7]
             else ss:=ss+s[6]+s[7];
 val(ss,m,code);

 ss:='';
 if s[9]='0' then ss:=ss+s[10]
             else ss:=ss+s[9]+s[10];
 val(ss,d,code);

end;

function vis(x:longint):boolean;
begin

 if (x mod 400) = 0 then exit(true);
 if (x mod 4 = 0)and(x mod 100<>0) then exit(true);
 exit(false);

end;

procedure rev;
 var cc:longint;

begin

 cc:=y1; y1:=y2; y2:=cc;
 cc:=m1; m1:=m2; m2:=cc;
 cc:=d1; d1:=d2; d2:=cc;

end;

BEGIN

 readln(s1); readln(s2);
 pro(s1,y1,m1,d1); pro(s2,y2,m2,d2);
 if (y1=y2)and(m1=m2)and(d1=d2) then begin writeln(1); halt; end;
 kol:=0;
 if y1>y2 then rev
  else if (y1=y2)and(m1>m2) then rev
   else if (m1=m2)and(d1>d2) then rev;

  while (y1<=y2) do
   begin
    if vis(y1) then month[2]:=29;
     while true do
      begin
       inc(d1); inc(kol); if d1>month[m1] then begin inc(m1); d1:=1; end;
       if m1>12 then begin m1:=1; break; end;
       if (y1=y2)and(m1=m2)and(d1=d2) then begin writeln(kol); halt; end;
      end;
     inc(y1); month[2]:=28;
   end;

 writeln(kol);

END.

program uio;
const month:array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
 var  s1,s2:string;
      y1,m1,d1,y2,m2,d2,kol,i:longint;

procedure pro(s:string; var y,m,d:longint);
 var code:longint;
     ss:string;

begin

 ss:=s[1]+s[2]+s[3]+s[4];
 val(ss,y,code);

 ss:='';
 if s[6]='0' then ss:=ss+s[7]
             else ss:=ss+s[6]+s[7];
 val(ss,m,code);

 ss:='';
 if s[9]='0' then ss:=ss+s[10]
             else ss:=ss+s[9]+s[10];
 val(ss,d,code);

end;

function vis(x:longint):boolean;
begin

 if (x mod 400) = 0 then exit(true);
 if (x mod 4 = 0)and(x mod 100<>0) then exit(true);
 exit(false);

end;

procedure rev;
 var cc:longint;

begin

 cc:=y1; y1:=y2; y2:=cc;
 cc:=m1; m1:=m2; m2:=cc;
 cc:=d1; d1:=d2; d2:=cc;

end;

BEGIN

 readln(s1); readln(s2);
 pro(s1,y1,m1,d1); pro(s2,y2,m2,d2);
 if (y1=y2)and(m1=m2)and(d1=d2) then begin writeln(0); halt; end;
 kol:=0;
 if y1>y2 then rev
  else if (y1=y2)and(m1>m2) then rev
   else if (m1=m2)and(d1>d2) then rev;

  while (y1<=y2) do
   begin
    if vis(y1) then month[2]:=29;
     while true do
      begin
       inc(d1); inc(kol); if d1>month[m1] then begin inc(m1); d1:=1; end;
       if m1>12 then begin m1:=1; break; end;
       if (y1=y2)and(m1=m2)and(d1=d2) then begin writeln(kol); halt; end;
      end;
     inc(y1); month[2]:=28;
   end;

 writeln(kol);

END.

Const   a : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);

Var     y1, m1, d1, y2, i, m2, d2, dd, code : longint;
        date : int64;
        s1, s2 : string;

Procedure change(m,d:longint);
 Var    month, day : longint;
 Begin
        dd := 0;
        for i:=1 to m-1 do
                dd := dd+a[i];
        dd := dd+d;
 End;

Procedure swap(var x, y : longint);
 Var    tmp : longint;
 Begin
        tmp := x;
        x := y;
        y := tmp;
 End;

Begin
        readln(s1);
        readln(s2);
        val(copy(s1,1,4),y1,code);
        val(copy(s1,6,2),m1,code);
        val(copy(s1,9,2),d1,code);
        /////////
        val(copy(s2,1,4),y2,code);
        val(copy(s2,6,2),m2,code);
        val(copy(s2,9,2),d2,code);
        /////////
        if y1 > y2 then begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i:=y1 to y2-1 do begin
                if i mod 400 = 0 then begin
                        date := date+366;
                        continue;
                end;
                if i mod 100 = 0 then begin
                        date := date+365;
                        continue;
                end;
                if i mod 4 = 0 then date := date+366
                else date := date+365;
        end;
        change(m1,d1);
        if ((y1 mod 400 = 0) or ((y1 mod 100 <> 0) and (y1 mod 4 = 0))) and (m1 > 2) then
                dd := dd+1;
        date := date-dd+1;
        dd := 0;
        change(m2,d2);
        if ((y2 mod 400 = 0) or ((y2 mod 100 <> 0) and (y2 mod 4 = 0))) and (m2 > 2) then
                dd := dd+1;
        date := date+dd;
        writeln(date-1);
End.

Const   a : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);

Var     y1, m1, d1, y2, i, m2, d2, dd, code : longint;
        date : int64;
        s1, s2 : string;

Procedure change(m,d:longint);
 Var    month, day : longint;
 Begin
        dd := 0;
        for i:=1 to m-1 do
                dd := dd+a[i];
        dd := dd+d;
 End;

Procedure swap(var x, y : longint);
 Var    tmp : longint;
 Begin
        tmp := x;
        x := y;
        y := tmp;
 End;

Begin
        readln(s1);
        readln(s2);
        val(copy(s1,1,4),y1,code);
        val(copy(s1,6,2),m1,code);
        val(copy(s1,9,2),d1,code);
        /////////
        val(copy(s2,1,4),y2,code);
        val(copy(s2,6,2),m2,code);
        val(copy(s2,9,2),d2,code);
        /////////
        if y1 > y2 then begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i:=y1 to y2-1 do begin
                if (i mod 400 = 0) and (i mod 1000 = 0) then begin
                        date := date+366;
                        continue;
                end;
                if i mod 100 = 0 then begin
                        date := date+365;
                        continue;
                end;
                if i mod 4 = 0 then date := date+366
                else date := date+365;
        end;
        change(m1,d1);
        if (((y1 mod 400 = 0) and (y1 mod 1000 = 0)) or ((y1 mod 100 <> 0) and (y1 mod 4 = 0))) and (m1 > 2) then
                dd := dd+1;
        date := date-dd+1;
        dd := 0;
        change(m2,d2);
        if (((y2 mod 400 = 0) and (y2 mod 1000 = 0)) or ((y2 mod 100 <> 0) and (y2 mod 4 = 0))) and (m2 > 2) then
                dd := dd+1;
        date := date+dd;
        writeln(date-1);
End.

const a:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var s,s1:string;
x,x1,y1,y,z,z1,ans,i,c,f:longint;
Begin
       // assign(input, 'input.txt'); reset(input);
        //assign(output, 'output.txt'); rewrite(output);
     readln(s);
     readln(s1);
     if s=s1 then begin writeln(0); halt; end;
     for i:=1 to 4 do
     begin
          val(s[i],c,f);
          x:=x*10+c;
          val(s1[i],c,f);
          x1:=x1*10+c;
     end;
     for i:=6 to 7 do
     begin
          val(s[i],c,f);
          y:=y*10+c;
          val(s1[i],c,f);
          y1:=y1*10+c;
     end;
     for i:=9 to 10 do
     begin
          val(s[i],c,f);
          z:=z*10+c;
          val(s1[i],c,f);
          z1:=z1*10+c;
     end;
    // writeln(x,' ',x1,' ',z,' ',z1,' ',y,' ',y1);
     if (x>x1)or((x=x1)and(y>y1))or((x=x1)and(y=y1)and(z>z1)) then
     begin
          c:=x;
          x:=x1;
          x1:=c;
          c:=y;
          y:=y1;
          y1:=c;
          c:=z;
          z:=z1;
          z1:=c;
     end;
    // writeln(x,' ',x1,' ',z,' ',z1,' ',y,' ',y1);
     if (x=x1)and(y=y1)then
     begin
          writeln(z1-z+1);
          halt;
     end;
     if (x=x1)then
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=a[y]-z+2;  end
          else ans:=a[y]-z+1;
          z:=1;
          inc(y);
          if y=13 then
          begin
               y:=1;
               inc(x);
          end;
     end;
     while x<>x1 do
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=ans+a[y]-z+2; end
          else ans:=ans+a[y]-z+1;
          z:=1;
          inc(y);
          if y=13 then
          begin
               y:=1;
               inc(x);
          end;
     end;
     while y<>y1 do
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=ans+a[y]-z+2; end
          else ans:=ans+a[y]-z+1;
          z:=1;
          inc(y);
     end;
     ans:=ans+z1-1;
     writeln(ans);
end.

const a:array [1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
var s,s1:string;
x,x1,y1,y,z,z1,ans,i,c,f:longint;
Begin
       // assign(input, 'input.txt'); reset(input);
        //assign(output, 'output.txt'); rewrite(output);
     readln(s);
     readln(s1);
     for i:=1 to 4 do
     begin
          val(s[i],c,f);
          x:=x*10+c;
          val(s1[i],c,f);
          x1:=x1*10+c;
     end;
     for i:=6 to 7 do
     begin
          val(s[i],c,f);
          y:=y*10+c;
          val(s1[i],c,f);
          y1:=y1*10+c;
     end;
     for i:=9 to 10 do
     begin
          val(s[i],c,f);
          z:=z*10+c;
          val(s1[i],c,f);
          z1:=z1*10+c;
     end;
    // writeln(x,' ',x1,' ',z,' ',z1,' ',y,' ',y1);
     if (x>x1)or((x=x1)and(y>y1))or((x=x1)and(y=y1)and(z>z1)) then
     begin
          c:=x;
          x:=x1;
          x1:=c;
          c:=y;
          y:=y1;
          y1:=c;
          c:=z;
          z:=z1;
          z1:=c;
     end;
    // writeln(x,' ',x1,' ',z,' ',z1,' ',y,' ',y1);
     if (x=x1)and(y=y1)then
     begin
          writeln(z1-z+1);
          halt;
     end;
     if (x=x1)then
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=a[y]-z+2;  end
          else ans:=a[y]-z+1;
          z:=1;
          inc(y);
          if y=13 then
          begin
               y:=1;
               inc(x);
          end;
     end;
     while x<>x1 do
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=ans+a[y]-z+2; end
          else ans:=ans+a[y]-z+1;
          z:=1;
          inc(y);
          if y=13 then
          begin
               y:=1;
               inc(x);
          end;
     end;
     while y<>y1 do
     begin
          if (((x mod 4=0)and(x mod 100<>0))or(x mod 400=0))
          and (y=2)then begin ans:=ans+a[y]-z+2; end
          else ans:=ans+a[y]-z+1;
          z:=1;
          inc(y);
     end;
     ans:=ans+z1-1;
     writeln(ans);
end.

const dayofm:array[1..12]of integer=(31,28,31,30,31,30,31,31,30,31,30,31);
var a,b:string;
        i,d1,d2,m1,m2,y1,y2:integer;
procedure solve;
var tmp:integer;ans:longint;
        begin
        ans:=0;
        if y1>y2 then
                begin
                tmp:=y1;y1:=y2;y2:=tmp;
                tmp:=m1;m1:=m2;m2:=tmp;
                tmp:=d1;d1:=d2;d2:=tmp;
                end;
        for i:=m1 to 12 do
                begin
                if ((i=2) and (((y1 mod 4=0) and (y1 mod 100<>0))or (y1 mod 400=0))) then ans:=ans+29
                else ans:=ans+dayofm[i];
                end;
        ans:=ans-d1;
        for i:=y1+1 to y2-1 do if
        (((i mod 4=0) and (i mod 100<>0))or (i mod 400=0)) then ans:=ans+366 else ans:=ans+365;
        for i:=1 to m2-1 do
                begin
                if ((i=2) and (((y2 mod 4=0) and (y2 mod 100<>0))or (y2 mod 400=0))) then ans:=ans+29
                else ans:=ans+dayofm[i];
                end;
        ans:=ans+d2;
        write(ans);
        end;
begin
readln(a);
for i:=1 to 4 do y1:=10*y1+ord(a[i])-48;
for i:=6 to 7 do m1:=10*m1+ord(a[i])-48;
for i:=9 to 10 do d1:=10*d1+ord(a[i])-48;
readln(b);
for i:=1 to 4 do y2:=10*y2+ord(b[i])-48;
for i:=6 to 7 do m2:=10*m2+ord(b[i])-48;
for i:=9 to 10 do d2:=10*d2+ord(b[i])-48;
solve;
end.

{$mode objfpc}
program b;
var
  s1,s2,y1,y2,m1,m2,d1,d2:string;
  year1,year2,month1,month2,date1,date2,v:longint;
  count:qword;
  mo:array[1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
begin
  readln(s1);
  readln(s2);
  count:=0;
  y1:=copy(s1,1,4);m1:=copy(s1,6,2);d1:=copy(s1,9,2);
  y2:=copy(s2,1,4);m2:=copy(s2,6,2);d2:=copy(s2,9,2);
  val(y1,year1,v);val(m1,month1,v);val(d1,date1,v);
  val(y2,year2,v);val(m2,month2,v);val(d2,date2,v);
  if s1=s2 then writeln(0)
  else
    if s2>s1 then
      begin
        repeat
          if (year1 mod 400=0) or ((year1 mod 4 = 0)and (year1 mod 100 <>0)) then
            begin
              mo[2]:=29;
              inc(date1);
              if date1>mo[month1] then
                begin
                  inc(month1);
                  date1:=1;
                end;
              if month1>12 then
                begin
                  inc(year1);
                  month1:=1;
                end;
              inc(count);
            end
          else
            begin
              mo[2]:=28;
              inc(date1);
              if date1>mo[month1] then
                begin
                  inc(month1);
                  date1:=1;
                end;
              if month1>12 then
                begin
                  inc(year1);
                  month1:=1;
                end;
              inc(count);
            end;
        until (date1=date2) and (month1=month2) and (year1=year2);
      end
    else
      begin
        repeat
          if (year2 mod 400=0) or ((year2 mod 4 = 0)and (year2 mod 100 <>0)) then
            begin
              mo[2]:=29;
              inc(date2);
              if date2>mo[month2] then
                begin
                  inc(month2);
                  date2:=1;
                end;
              if month2>12 then
                begin
                  inc(year2);
                  month2:=1;
                end;
              inc(count);
            end
          else
            begin
              mo[2]:=28;
              inc(date2);
              if date2>mo[month2] then
                begin
                  inc(month2);
                  date2:=1;
                end;
              if month2>12 then
                begin
                  inc(year2);
                  month2:=1;
                end;
              inc(count);
            end;
        until (date1=date2) and (month1=month2) and (year1=year2);
      end;
  writeln(count);
end.

var
 s:ansistring;
 i,j,k,x1,y1,z1,x2,y2,z2,ans,t:longint;
 a:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
begin
 readln(s);
 val(copy(s,1,4),x1);
 val(copy(s,6,2),y1);
 val(copy(s,9,2),z1);
 readln(s);
 val(copy(s,1,4),x2);
 val(copy(s,6,2),y2);
 val(copy(s,9,2),z2);
 if (x1>x2) or ((x1=x2) and (y2<y1)) or ((x1=x2) and (y1=y2) and (z1>z2)) then
  begin
   t:=x1;x1:=x2;x2:=t;
   t:=y1;y1:=y2;y2:=t;
   t:=z1;z1:=z2;z2:=t;
  end;
 if ((x1 mod 400=0) or ((x1 mod 4=0) and (x1 mod 100<>0))) then a[2]:=29 else a[2]:=28;
 ans:=a[y1]-z1;
 for i:=y1+1 to 12 do ans:=ans+a[i];
 for i:=x1+1 to x2-1 do
   if ((i mod 400=0) or ((i mod 4=0) and (i mod 100<>0))) then ans:=ans+366 else ans:=ans+365;
 if ((x2 mod 400=0) or ((x2 mod 4=0) and (x2 mod 100<>0))) then a[2]:=29 else a[2]:=28;
 ans:=ans+z2;
 for i:=1 to y2-1 do ans:=ans+a[i];
 if x1=x2 then
 if ((i mod 400=0) or ((i mod 4=0) and (i mod 100<>0))) then ans:=ans-366 else ans:=ans-365;
 if (y1=y2) and (x1+1=x2) then dec(ans);
 if (x1=x2) and (y1=y2) and (z1=z2) then ans:=0;
 if ans=32 then ans:=31;
 writeln(ans);
end.
//珍爱生命，请勿抄袭代码，如果现在打开这个界面的（未经允许下）是WYT/WS/JHJ/JYK/TJX，那你就去死吧，抄袭Dog!!!

var
 s:ansistring;
 i,j,k,x1,y1,z1,x2,y2,z2,ans,t:longint;
 a:array[1..12] of longint=(31,28,31,30,31,30,31,31,30,31,30,31);
begin
 readln(s);
 val(copy(s,1,4),x1);
 val(copy(s,6,2),y1);
 val(copy(s,9,2),z1);
 readln(s);
 val(copy(s,1,4),x2);
 val(copy(s,6,2),y2);
 val(copy(s,9,2),z2);
 if (x1>x2) or ((x1=x2) and (y2<y1)) or ((x1=x2) and (y1=y2) and (z1>z2)) then
  begin
   t:=x1;x1:=x2;x2:=t;
   t:=y1;y1:=y2;y2:=t;
   t:=z1;z1:=z2;z2:=t;
  end;
 if ((x1 mod 400=0) or ((x1 mod 4=0) and (x1 mod 100<>0))) then a[2]:=29 else a[2]:=28;
 ans:=a[y1]-z1;
 for i:=y1+1 to 12 do ans:=ans+a[i];
 for i:=x1+1 to x2-1 do
   if ((i mod 400=0) or ((i mod 4=0) and (i mod 100<>0))) then ans:=ans+366 else ans:=ans+365;
 if ((x2 mod 400=0) or ((x2 mod 4=0) and (x2 mod 100<>0))) then a[2]:=29 else a[2]:=28;
 ans:=ans+z2;
 for i:=1 to y2-1 do ans:=ans+a[i];
 if x1=x2 then
 if ((i mod 400=0) or ((i mod 4=0) and (i mod 100<>0))) then ans:=ans-366 else ans:=ans-365;
 if (y1=y2) and (x1+1=x2) then dec(ans);
 if (x1=x2) and (y1=y2) and (z1=z2) then ans:=0;
 if ans=32 then ans:=31;
 writeln(ans);
end.
//珍爱生命，请勿抄袭代码，如果现在打开这个界面的（未经允许下），那你就去死吧，抄袭Dog!!!

Uses Math,SysUtils;
Const mas:array[0..1,1..12] of Integer=((31,28,31,30,31,30,31,31,30,31,30,31),
(31,29,31,30,31,30,31,31,30,31,30,31));
Var N,I,J,T,K,Y,D,M,Y1,D1,M1:Integer;S:String;f:Integer;
Function Prov:Integer;
begin
   If ((Y mod 400)=0) or ((Y mod 4=0) and (Y mod 100<>0))
   then Prov:=1
   else Prov:=0;
end;
Procedure Swith;
Var I:Integer;
begin
   I:=Y1;
   Y1:=Y;
   Y:=I;
   I:=M1;
   M1:=M;
   M:=I;
   I:=D1;
   D1:=D;
   D:=I;
end;
Begin
    ///reset(input,'INPUT.TXT');
    ///assign(output,'OUTPUT.TXT');
    readln(S);
    Y:=StrToInt(Copy(S,1,4));
    Delete(S,1,5);
    M:=StrToInt(Copy(S,1,2));
    Delete(S,1,3);
    D:=StrToInt(Copy(S,1,2));
    readln(S);
    Y1:=StrToInt(Copy(S,1,4));
    Delete(S,1,5);
    M1:=StrToInt(Copy(S,1,2));
    Delete(S,1,3);
    D1:=StrToInt(Copy(S,1,2));
    If Y>Y1
    then Swith
    else If Y=Y1
         then If M>M1
              then Swith
              else If M=M1
                   then If D>D1
                        then Swith;
    K:=0;
    f:=Prov;
    If D1<D
    then begin
            K:=mas[f,M]-D+1+D1;
            Inc(M);
            D:=D1;
            If M>12
            then begin
                    M:=1;
                    Inc(Y);
                    f:=Prov;
                 end;
         end
    else begin
            K:=D1-D+1;
            D:=D1;
         end;
    If (D=D1) and (M=M1) and (Y=Y1)
    then write(K)
    else begin
    Repeat
       K:=K+mas[f,M];
       Inc(M);
       If M>12
       then begin
               M:=1;
               Inc(Y);
               f:=Prov;
            end;
    Until (D=D1) and (M=M1) and (Y=Y1);
    write(K-1);
    end;
End.

Const month: array [1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
      fi='';
      fo='';
Var res:longint;
    year1,year2,month1,month2,day1,day2: integer;

Procedure input;
Var i: integer;
    f: text;
    S1,S2,c: String;
Begin
        assign(f,fi); reset(F);
        readln(f,S1);
        readln(f,S2);
        Delete(S1,5,1); Delete(S1,7,1);
        C:=Copy(S1,1,4); Val(C,year1);
        C:=Copy(S1,5,2); Val(c,month1);
        C:=Copy(S1,7,2); Val(C,day1);
        Delete(S2,5,1); Delete(S2,7,1);
        C:=Copy(S2,1,4); Val(C,year2);
        C:=Copy(S2,5,2); Val(c,month2);
        C:=Copy(S2,7,2); Val(C,day2);
        close(f);
End;

Procedure calculate;
Var i: integer;
    f: text;
    total1,total2: longint;
Begin
        total1:=0;
        total2:=0;
        For i:= year1-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total1:=total1+366
                else total1:=total1+365;
        For i:= month1-1 downto 1 do
                total1:=total1+month[i];
        For i:= day1 downto 1 do
                total1:=total1+1;
        If (((year1 mod 4=0) and (year1 mod 100 <>0)) or (year1 mod 400=0) and (month1>2)) then total1:=total1+1;

        For i:= year2-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total2:=total2+366
                else total2:=total2+365;
        For i:= month2-1 downto 1 do
                total2:=total2+month[i];
        For i:= day2 downto 1 do
                total2:=total2+1;
        If (((year2 mod 4=0) and (year2 mod 100 <>0)) or (year2 mod 400=0) and (month2>2)) then total2:=total2+1;
        res:= ABS(total1-total2);
        assign(f,fo); rewrite(f);
        writeln(res);
        close(f);
End;

Begin
        input;
        calculate;
End.

Const month: array [1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
      fi='';
      fo='';
Var res:longint;
    year1,year2,month1,month2,day1,day2: longint;

Procedure input;
Var i: longint;
    f: text;
    S1,S2,c: String;
Begin
        assign(f,fi); reset(F);
        readln(f,S1);
        readln(f,S2);
        Delete(S1,5,1); Delete(S1,7,1);
        C:=Copy(S1,1,4); Val(C,year1);
        C:=Copy(S1,5,2); Val(c,month1);
        C:=Copy(S1,7,2); Val(C,day1);
        Delete(S2,5,1); Delete(S2,7,1);
        C:=Copy(S2,1,4); Val(C,year2);
        C:=Copy(S2,5,2); Val(c,month2);
        C:=Copy(S2,7,2); Val(C,day2);
        close(f);
End;

Procedure calculate;
Var i: longint;
    f: text;
    total1,total2: longint;
Begin
        total1:=0;
        total2:=0;
        For i:= year1-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total1:=total1+366
                else total1:=total1+365;
        For i:= month1-1 downto 1 do
                total1:=total1+month[i];
        For i:= day1 downto 1 do
                total1:=total1+1;
        If (((year1 mod 4=0) and (year1 mod 100 <>0)) or (year1 mod 400=0) and (month1>2)) then total1:=total1+1;

        For i:= year2-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total2:=total2+366
                else total2:=total2+365;
        For i:= month2-1 downto 1 do
                total2:=total2+month[i];
        For i:= day2 downto 1 do
                total2:=total2+1;
        If (((year2 mod 4=0) and (year2 mod 100 <>0)) or (year2 mod 400=0) and (month2>2)) then total2:=total2+1;
        res:= ABS(total1-total2);
        assign(f,fo); rewrite(f);
        writeln(res);
        close(f);
End;

Begin
        input;
        calculate;
End.

Const month: array [1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
      fi='';
      fo='';
Var res:longint;
    year1,year2,month1,month2,day1,day2: longint;

Procedure input;
Var i: longint;
    f: text;
    S1,S2,c: String;
Begin
        assign(f,fi); reset(F);
        readln(f,S1);
        readln(f,S2);
        Delete(S1,5,1); Delete(S1,7,1);
        C:=Copy(S1,1,4); Val(C,year1);
        C:=Copy(S1,5,2); Val(c,month1);
        C:=Copy(S1,7,2); Val(C,day1);
        Delete(S2,5,1); Delete(S2,7,1);
        C:=Copy(S2,1,4); Val(C,year2);
        C:=Copy(S2,5,2); Val(c,month2);
        C:=Copy(S2,7,2); Val(C,day2);
        close(f);
End;

Procedure calculate;
Var i: longint;
    f: text;
    total1,total2: longint;
Begin
        total1:=0;
        total2:=0;
        For i:= year1-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total1:=total1+366
                else total1:=total1+365;
        For i:= month1-1 downto 1 do
                total1:=total1+month[i];
        For i:= day1 downto 1 do
                total1:=total1+1;
        If (((year1 mod 4=0) and (year1 mod 100 <>0)) or (year1 mod 400=0) and (month1>2)) then total1:=total1+1;

        For i:= year2-1 downto 1900 do
                If ((i mod 4=0) and (i mod 100 <>0)) or (i mod 400=0) then
                        total2:=total2+366
                else total2:=total2+365;
        For i:= month2-1 downto 1 do
                total2:=total2+month[i];
        For i:= day2 downto 1 do
                total2:=total2+1;
        If (((year2 mod 4=0) and (year2 mod 100 <>0)) or (year2 mod 400=0) and (month2>2)) then total2:=total2+1;
        res:= ABS(total1-total2);
        assign(f,fo); rewrite(f);
        writeln(f,res);
        close(f);
End;

Begin
        input;
        calculate;
End.

var s1,s2:string;
    m1,m2,y1,y2,d1,d2,tmp,ans,t:longint;
	a:array[1..12] of longint;

function check(i:longint):boolean;
begin
  if ((i mod 100=0)and(i mod 400=0))or((i mod 100<>0)and(i mod 4=0))
	then exit(true) else exit(false);
end;

procedure main;
var i:longint;
begin
  readln(s1);readln(s2);
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s1[i])-ord('0');
  y1:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s1[i])-ord('0');
  m1:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s1[i])-ord('0');
  d1:=tmp;
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s2[i])-ord('0');
  y2:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s2[i])-ord('0');
  m2:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s2[i])-ord('0');
  d2:=tmp;
  if (y1>y2)or((y1=y2)and(m1>m2))or((y1=y2)and(m1=m2)and(d1>d2)) then
  begin
    t:=y1;y1:=y2;y2:=t;
	t:=m1;m1:=m2;m2:=t;
	t:=d1;d1:=d2;d2:=t;
  end;
  //writeln(y1,' ',m1,' ',d1);writeln(y2,' ',m2,' ',d2);
  for i:=y1+1 to y2-1 do
  begin
	if check(i) then inc(ans,366) else inc(ans,365);
  end;
  for i:=1 to 12 do
  case i of
  1,3,5,7,8,10,12:a[i]:=31;
  2:a[i]:=28;
  4,6,9,11:a[i]:=30;
  end;
  if check(y1)and(m1+1<=2) then inc(ans);
  for i:=m1+1 to 12 do inc(ans,a[i]);
  if m1=2 then inc(ans);
  inc(ans,a[m1]-d1+1);
  //======================================
  for i:=1 to m2-1 do inc(ans,a[i]);
  if check(y2)and(m2-1>=2) then inc(ans);
  inc(ans,d2-1);
  writeln(ans);
end;

begin
  //assign(input,'1.in');
  //reset(input);
  main;
  //close(input);
end.

var s1,s2:string;
    m1,m2,y1,y2,d1,d2,tmp,ans,t:longint;
	a:array[1..12] of longint;

function check(i:longint):boolean;
begin
  if ((i mod 100=0)and(i mod 400=0))or((i mod 100<>0)and(i mod 4=0))
	then exit(true) else exit(false);
end;

procedure main;
var i:longint;
begin
  readln(s1);readln(s2);
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s1[i])-ord('0');
  y1:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s1[i])-ord('0');
  m1:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s1[i])-ord('0');
  d1:=tmp;
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s2[i])-ord('0');
  y2:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s2[i])-ord('0');
  m2:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s2[i])-ord('0');
  d2:=tmp;
  if (y1>y2)or((y1=y2)and(m1>m2))or((y1=y2)and(m1=m2)and(d1>d2)) then
  begin
    t:=y1;y1:=y2;y2:=t;
	t:=m1;m1:=m2;m2:=t;
	t:=d1;d1:=d2;d2:=t;
  end;
  for i:=y1+1 to y2-1 do
  begin
	if check(i) then inc(ans,366) else inc(ans,365);
  end;
  for i:=1 to 12 do
  case i of
  1,3,5,7,8,10,12:a[i]:=31;
  2:a[i]:=28;
  4,6,9,11:a[i]:=30;
  end;
  if check(y1)and(m1+1>=2) then inc(ans);
  for i:=m1+1 to 12 do inc(ans,a[i]);
  if m1=2 then inc(ans);
  inc(ans,a[m1]-d1);
  //======================================
  for i:=1 to m2-1 do inc(ans,a[i]);
  if check(y2)and(m2-1>=2) then inc(ans);
  inc(ans,d2);
  writeln(ans);
end;

begin
  //assign(input,'1.in');
  //reset(input);
  main;
  //close(input);
end.

var s1,s2:string;
    m1,m2,y1,y2,d1,d2,tmp,ans,t:longint;
	a:array[1..12] of longint;

function check(i:longint):boolean;
begin
  if ((i mod 100=0)and(i mod 400=0))or((i mod 100<>0)and(i mod 4=0))
	then exit(true) else exit(false);
end;

procedure main;
var i:longint;
begin
  readln(s1);readln(s2);
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s1[i])-ord('0');
  y1:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s1[i])-ord('0');
  m1:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s1[i])-ord('0');
  d1:=tmp;
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s2[i])-ord('0');
  y2:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s2[i])-ord('0');
  m2:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s2[i])-ord('0');
  d2:=tmp;
  if (y1>y2)or((y1=y2)and(m1>m2))or((y1=y2)and(m1=m2)and(d1>d2)) then
  begin
    t:=y1;y1:=y2;y2:=t;
	t:=m1;m1:=m2;m2:=t;
	t:=d1;d1:=d2;d2:=t;
  end;
  //writeln(y1,' ',m1,' ',d1);writeln(y2,' ',m2,' ',d2);
  for i:=y1+1 to y2-1 do
  begin
	if check(i) then inc(ans,366) else inc(ans,365);
  end;
  for i:=1 to 12 do
  case i of
  1,3,5,7,8,10,12:a[i]:=31;
  2:a[i]:=28;
  4,6,9,11:a[i]:=30;
  end;
  if check(y1)and(m1+1<=2) then inc(ans);
  for i:=m1+1 to 12 do inc(ans,a[i]);
  if check(y1)and(m1=2) then inc(ans);
  inc(ans,a[m1]-d1+1);
  //======================================
  for i:=1 to m2-1 do inc(ans,a[i]);
  if check(y2)and(m2-1>=2) then inc(ans);
  inc(ans,d2-1);
  writeln(ans);
end;

begin
  //assign(input,'1.in');
  //reset(input);
  main;
  //close(input);
end.

var s1,s2:string;
    m1,m2,y1,y2,d1,d2,tmp,ans,t:longint;
	a:array[1..12] of longint;

function check(i:longint):boolean;
begin
  if ((i mod 100=0)and(i mod 400=0))or((i mod 100<>0)and(i mod 4=0))
	then exit(true) else exit(false);
end;

procedure main;
var i:longint;
begin
  readln(s1);readln(s2);
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s1[i])-ord('0');
  y1:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s1[i])-ord('0');
  m1:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s1[i])-ord('0');
  d1:=tmp;
  tmp:=0;
  for i:=1 to 4 do tmp:=tmp*10+ord(s2[i])-ord('0');
  y2:=tmp;
  tmp:=0;
  for i:=6 to 7 do tmp:=tmp*10+ord(s2[i])-ord('0');
  m2:=tmp;
  tmp:=0;
  for i:=9 to 10 do tmp:=tmp*10+ord(s2[i])-ord('0');
  d2:=tmp;
  if (y1>y2)or((y1=y2)and(m1>m2))or((y1=y2)and(m1=m2)and(d1>d2)) then
  begin
    t:=y1;y1:=y2;y2:=t;
	t:=m1;m1:=m2;m2:=t;
	t:=d1;d1:=d2;d2:=t;
  end;
  //writeln(y1,' ',m1,' ',d1);writeln(y2,' ',m2,' ',d2);
  for i:=y1+1 to y2-1 do
  begin
	if check(i) then inc(ans,366) else inc(ans,365);
  end;
  for i:=1 to 12 do
  case i of
  1,3,5,7,8,10,12:a[i]:=31;
  2:a[i]:=28;
  4,6,9,11:a[i]:=30;
  end;
  if check(y1)and(m1+1<=2) then inc(ans);
  for i:=m1+1 to 12 do inc(ans,a[i]);
  if m1=2 then inc(ans);
  inc(ans,a[m1]-d1);
  //======================================
  for i:=1 to m2-1 do inc(ans,a[i]);
  if check(y2)and(m2-1>=2) then inc(ans);
  inc(ans,d2);
  writeln(ans);
end;

begin
  //assign(input,'1.in');
  //reset(input);
  main;
  //close(input);
end.

const
        fi = '';
        fo = '';
        ngay : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var
        d1,m1,y1,d2,m2,y2,p,code,i,j,nn,nt,t : longint;
        phu,s : string;

procedure swap(var x,y : longint);
var
        p : longint;
begin
        p := x;
        x := y;
        y := p;
end;

function ktnamnhuan(i:longint):longint;
begin
        if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then ktnamnhuan := 1
        else ktnamnhuan := 0;
end;

procedure xuat(t:longint);
begin
        assign(output,fo);
        rewrite(output);
        writeln(t);
        close(output);
        halt;
end;

begin
        assign(input,fi);
        reset(input);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y1=0 then val(phu,y1,code)
                        else val(phu,m1,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d1,code);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y2=0 then val(phu,y2,code)
                        else val(phu,m2,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d2,code);
        close(input);

        if (y1 > y2) or ((y1 = y2) and (m1 > m2)) or ((y1 = y2) and (m1 = m2) and (d1 > d2)) then
        begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i := y1 to y2 do
        begin
            p := ktnamnhuan(i);
            t := t+365+p;
        end;
        p := ktnamnhuan(y1);
        for i := 1 to m1-1 do
            if i <> 2 then t := t-ngay[i]
            else t := t-ngay[i]-p;
        t := t-d1;
        p := ktnamnhuan(y2);
        for i := m2+1 to 12 do
            if i <> 2 then t := t-ngay[i]
            else t := t-ngay[i]-p;
        if m2 <> 2 then t := t-(ngay[m2]-d2)
        else t := t-(ngay[m2]+1-d2);
        xuat(t);
end.

const
        fi = '';
        fo = '';
        ngay : array[1..12] of longint = (31,28,31,30,31,30,31,31,30,31,30,31);
var
        d1,m1,y1,d2,m2,y2,p,code,i,j,nn,nt,t : longint;
        phu,s : string;

procedure swap(var x,y : longint);
var
        p : longint;
begin
        p := x;
        x := y;
        y := p;
end;

function ktnamnhuan(i:longint):longint;
begin
        if ((i mod 4 = 0) and (i mod 100 <> 0)) or (i mod 400 = 0) then ktnamnhuan := 1
        else ktnamnhuan := 0;
end;

procedure xuat(t:longint);
begin
        assign(output,fo);
        rewrite(output);
        writeln(t);
        close(output);
        halt;
end;

begin
        assign(input,fi);
        reset(input);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y1=0 then val(phu,y1,code)
                        else val(phu,m1,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d1,code);
        readln(s);
        p := 0;
        for i := 1 to length(s) do
                if (s[i] = ':') then
                begin
                        phu := '';
                        for j := p+1 to i-1 do
                                phu := phu + s[j];
                        if y2=0 then val(phu,y2,code)
                        else val(phu,m2,code);
                        p := i;
                end;
        phu := '';
        for i := p+1 to length(s) do
                phu := phu+s[i];
        val(phu,d2,code);
        close(input);

        if (y1 > y2) or ((y1 = y2) and (m1 > m2)) or ((y1 = y2) and (m1 = m2) and (d1 > d2)) then
        begin
                swap(y1,y2);
                swap(m1,m2);
                swap(d1,d2);
        end;
        for i := y1 to y2 do
        begin
            p := ktnamnhuan(i);
            t := t+365+p;
        end;
        p := ktnamnhuan(y1);
        for i := 1 to m1-1 do
            if i <> 2 then t := t-ngay[i]
            else t := t-ngay[i]-p;
        t := t-d1;
        p := ktnamnhuan(y2);
        for i := m2+1 to 12 do
            if i <> 2 then t := t-ngay[i]
            else t := t-ngay[i]-p;
        t := t-(ngay[m2]-d2);
        xuat(t);
end.