#include <bits/stdc++.h>
int y, m, d;
int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int loop(int y) {
  if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) return 1;
  return 0;
}
int count() {
  int sum = 0;
  for (int i = 1; i < y; i++) {
    sum += 365;
    if (loop(i)) sum++;
  }
  for (int i = 1; i < m; i++) sum += a[i];
  if (loop(y) && m > 2) sum += 1;
  sum += d;
  return sum;
}
int main() {
  scanf("%d:%d:%d", &y, &m, &d);
  int ans1 = count();
  scanf("%d:%d:%d", &y, &m, &d);
  int ans2 = count();
  printf("%d\n", abs(ans2 - ans1));
  return 0;
}
