#include <bits/stdc++.h>
using namespace std;
long long Calculation(int y, int m, int d) {
  if (m < 3) {
    y -= 1;
    m += 12;
  }
  return 365 * y + y / 4 - y / 100 + y / 400 + (153 * m - 457) / 5 + d - 306;
}
int main() {
  int y, m, d;
  scanf("%d:%d:%d", &y, &m, &d);
  long long a = Calculation(y, m, d);
  scanf("%d:%d:%d", &y, &m, &d);
  long long b = Calculation(y, m, d);
  printf("%lld\n", abs(b - a));
  return 0;
}
