#include <bits/stdc++.h>
using namespace std;
vector<int> m = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int y, m1, d1, y2, m2, d2, s[13];
bool is_leap(int x) {
  if (x % 100 == 0) return !(x % 400);
  return !(x % 4);
}
int main() {
  scanf("%d:%d:%d", &y, &m1, &d1);
  scanf("%d:%d:%d", &y2, &m2, &d2);
  for (int i = 1; i <= 12; i++) s[i] = s[i - 1] + m[i - 1];
  long long ans2 = 0ll + d2 + s[m2 - 1] + (m2 > 2) * is_leap(y2);
  long long ans1 = 0ll + d1 + s[m1 - 1] + (m1 > 2) * is_leap(y);
  for (int i = 1; i < y; i++) ans1 += (is_leap(i) ? 366 : 365);
  for (int i = 1; i < y2; i++) ans2 += (is_leap(i) ? 366 : 365);
  printf("%lld\n", abs(ans1 - ans2));
}
