#include <bits/stdc++.h>
using namespace std;
struct KK {
  int y, m, d;
} a1, a2;
const int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  int i;
  while (scanf(" %d:%d:%d", &a1.y, &a1.m, &a1.d) == 3) {
    scanf(" %d:%d:%d", &a2.y, &a2.m, &a2.d);
    if (a1.y > a2.y) {
      KK t = a1;
      a1 = a2;
      a2 = t;
    }
    int n = 365 * (a2.y - a1.y + 1);
    for (i = a1.y; i <= a2.y; i++)
      if ((!(i % 4) && (i % 100)) || !(i % 400)) n++;
    for (i = 1; i < a1.m; i++) n -= mon[i];
    if (((!(a1.y % 4) && (a1.y % 100)) || !(a1.y % 400)) && (a1.m > 2)) n--;
    n -= a1.d;
    n -= (mon[a2.m] - a2.d);
    if (((!(a2.y % 4) && (a2.y % 100)) || !(a2.y % 400)) && (a2.m <= 2)) n--;
    for (i = a2.m + 1; i < 13; i++) n -= mon[i];
    cout << abs(n) << endl;
  }
  return 0;
}
