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