#include <bits/stdc++.h>
using namespace std;
int month_days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int y, m, d, Y, M, D;
void check(int y1, int m1, int d1, int y2, int m2, int d2) {
  if (y1 < y2) {
    y = y1, m = m1, d = d1;
    Y = y2, M = m2, D = d2;
  } else if (y1 >= y2) {
    y = y2, m = m2, d = d2;
    Y = y1, M = m1, D = d1;
  }
}
long long calc_days(int y, int m, int d) {
  long long int i, total_days = 0;
  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))
    month_days[2] = 29;
  else
    month_days[2] = 28;
  for (i = 1; i < m; i++) total_days += month_days[i];
  total_days += d;
  return total_days;
}
int main() {
  long long int d1, d2, m1, m2, y1, y2, i, before, after;
  while (scanf("%I64d:%I64d:%I64d", &y1, &m1, &d1) == 3) {
    scanf("%I64d:%I64d:%I64d", &y2, &m2, &d2);
    check(y1, m1, d1, y2, m2, d2);
    before = calc_days(y, m, d);
    after = calc_days(Y, M, D);
    for (i = y; i < Y; i++) {
      if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0))
        after += 366;
      else
        after += 365;
    }
    printf("%I64d\n", abs(after - before));
  }
  return 0;
}
