#include <bits/stdc++.h>
using namespace std;
int mouth[13][2] = {0,  0,  31, 31, 28, 29, 31, 31, 30, 30, 31, 31, 30,
                    30, 31, 31, 31, 31, 30, 30, 31, 31, 30, 30, 31, 31};
int sum[13][2];
int check(int year) {
  if ((year % 100 != 0 && year % 4 == 0) || year % 400 == 0) return 1;
  return 0;
}
int main() {
  int year1, mouth1, day1, year2, mouth2, day2, ok, ans = 0;
  for (int i = 1; i < 13; i++)
    sum[i][1] = sum[i - 1][1] + mouth[i][1],
    sum[i][0] = sum[i - 1][0] + mouth[i][0];
  scanf("%d:%d:%d", &year1, &mouth1, &day1);
  scanf("%d:%d:%d", &year2, &mouth2, &day2);
  if (year1 > year2 || (year1 == year2 && mouth1 > mouth2) ||
      (year1 == year2 && mouth1 == mouth2 && day1 > day2)) {
    swap(year1, year2);
    swap(mouth1, mouth2);
    swap(day1, day2);
  }
  if (year1 == year2) {
    ok = check(year1);
    ans = sum[mouth2 - 1][ok] + day2 - sum[mouth1 - 1][ok] - day1;
    cout << ans << endl;
    return 0;
  }
  ok = check(year1);
  ans += sum[mouth1 - 1][ok] + day1;
  ans = (ok ? 366 : 365) - ans;
  for (int i = year1 + 1; i < year2; i++) {
    if (check(i))
      ans += 366;
    else
      ans += 365;
  }
  ok = check(year2);
  ans += sum[mouth2 - 1][ok] + day2;
  cout << ans << endl;
  return 0;
}
