#include <bits/stdc++.h>
const int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int y, m, d, v1, v2;
bool is_leap(int y) {
  if (y % 400 == 0) return true;
  if (y % 100 == 0) return false;
  if (y % 4 == 0) return true;
  return false;
}
int calc(int y, int m, int d) {
  int res = 0;
  for (int i = 1900; i < y; i++) res += is_leap(i) ? 366 : 365;
  for (int i = 1; i < m; i++) {
    res += days[i];
    if (i == 2 && is_leap(y)) res++;
  }
  return res + d;
}
int main() {
  scanf("%d:%d:%d", &y, &m, &d);
  v1 = calc(y, m, d);
  scanf("%d:%d:%d", &y, &m, &d);
  v2 = calc(y, m, d);
  printf("%d\n", labs(v1 - v2));
  return 0;
}
