#include <bits/stdc++.h>
using namespace std;
int N, M, ans;
inline void Read(int &x) {
  x = 0;
  int s = 1;
  char a = getchar();
  while (a < '0' || '9' < a) {
    if (a == '-') s = -1;
    a = getchar();
  }
  while ('0' <= a && a <= '9') {
    x = x * 10 + a - '0';
    a = getchar();
  }
  x *= s;
}
inline void Write(int x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) Write(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  int a, b, c, d, e, f;
  char ka;
  cin >> a >> ka >> b >> ka >> c;
  cin >> d >> ka >> e >> ka >> f;
  if (a > d || (a == d && b > e) || (a == d && b == e && c > f))
    swap(a, d), swap(b, e), swap(c, f);
  while (a != d || b != e || c != f) {
    c++;
    if ((a % 4 == 0 && a % 100 != 0) || a % 400 == 0) {
      if (b == 2 && c == 30) b++, c = 1;
      if ((b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 ||
           b == 12) &&
          c == 32)
        b++, c = 1;
      if (b == 13) a++, b = 1;
      if ((b == 4 || b == 6 || b == 9 || b == 11) && c == 31) b++, c = 1;
    } else {
      if (b == 2 && c == 29) b++, c = 1;
      if ((b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 ||
           b == 12) &&
          c == 32)
        b++, c = 1;
      if (b == 13) a++, b = 1;
      if ((b == 4 || b == 6 || b == 9 || b == 11) && c == 31) b++, c = 1;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
