#include <bits/stdc++.h>
using namespace std;
long long date(int y, int m, int d) {
  if (m < 3) y--, m += 12;
  return (long long)365 * y + y / 4 - y / 100 + y / 400 + (153 * m - 457) / 5 +
         d - 306;
}
int main() {
  int y1, y2, m1, m2, d1, d2;
  scanf("%d:%d:%d", &y1, &m1, &d1);
  scanf("%d:%d:%d", &y2, &m2, &d2);
  printf("%lld\n", llabs(date(y1, m1, d1) - date(y2, m2, d2)));
  return 0;
}
