#include <bits/stdc++.h>
using namespace std;
bool isleap(int n) {
  if (n % 400 == 0) return true;
  if (n % 100 == 0) return false;
  if (n % 4 == 0)
    return true;
  else
    return false;
}
int arr[2][12] = {{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
                  {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
int day(int a, int b, int c) {
  int x = a - 1900;
  int ctr = 0;
  for (int i = 1900; i < a; i++) {
    if (isleap(i)) ctr++;
  }
  int ans = x * 365 + ctr;
  int s = 0;
  if (isleap(a)) {
    for (int i = 0; i < b - 1; i++) {
      s = s + arr[1][i];
    }
    ans = ans + s;
    s = c - 1;
    ans = ans + s;
  } else {
    for (int i = 0; i < b - 1; i++) {
      s = s + arr[0][i];
    }
    ans = ans + s;
    s = c - 1;
    ans = ans + s;
  }
  return ans;
}
int main() {
  char da1[50];
  char da2[50];
  cin >> da1;
  cin >> da2;
  int a = (da1[0] - '0') * 1000 + (da1[1] - '0') * 100 + (da1[2] - '0') * 10 +
          (da1[3] - '0');
  int b = (da1[5] - '0') * 10 + (da1[6] - '0');
  int c = (da1[8] - '0') * 10 + (da1[9] - '0');
  int d = (da2[0] - '0') * 1000 + (da2[1] - '0') * 100 + (da2[2] - '0') * 10 +
          (da2[3] - '0');
  int e = (da2[5] - '0') * 10 + (da2[6] - '0');
  int f = (da2[8] - '0') * 10 + (da2[9] - '0');
  int x = day(a, b, c);
  int y = day(d, e, f);
  int ans = abs(x - y);
  cout << ans;
  cin >> a;
  return 0;
}
