#include <bits/stdc++.h>
using namespace std;
long long calc(int y, int m, int d) {
  if (m < 3) {
    y--;
    m += 12;
  }
  return 365 * y + y / 4 - y / 100 + y / 400 + (153 * m - 457) / 5 + d - 306;
}
int main() {
  int a, b, c, d, e, f;
  scanf("%d:%d:%d", &a, &b, &c);
  scanf("%d:%d:%d", &d, &e, &f);
  long long x = calc(a, b, c), y = calc(d, e, f);
  cout << abs(x - y) << endl;
}
