#include <bits/stdc++.h>
bool check(int n) {
  if ((n % 100) == 0 && (n % 400) == 0) return true;
  if ((n % 4) == 0 && (n % 100)) return true;
  return false;
}
const int f[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  int a, b, c, cnta = 0, cntb = 0, i;
  char op, oo;
  scanf("%d %c %d %c %d", &a, &op, &b, &oo, &c);
  cnta += (a - 1) * 365;
  for (i = 1; i < b; i++) cnta += f[i];
  cnta += c;
  for (i = 1; i <= a; i++) {
    if ((i < a) || (b > 2))
      if (check(i)) cnta++;
  }
  scanf("%d %c %d %c %d", &a, &op, &b, &oo, &c);
  cntb += (a - 1) * 365;
  for (i = 1; i < b; i++) cntb += f[i];
  cntb += c;
  for (i = 1; i <= a; i++) {
    if ((i < a) || (b > 2))
      if (check(i)) cntb++;
  }
  printf("%d\n", abs(cnta - cntb));
  return 0;
}
