#include <bits/stdc++.h>
using namespace std;
struct date_t {
  int y, m, d;
};
int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int leaps[] = {1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936,
               1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972,
               1976, 1980, 1984, 1988, 1992, 1996, 2000, 2004, 2008,
               2012, 2016, 2020, 2024, 2028, 2032, 2036, 2040};
bool leap[2050];
void cmp(date_t &a, date_t &b) {
  if (a.y < b.y) return;
  if (a.y == b.y && a.m < b.m) return;
  if (a.y == b.y && a.m == b.m && a.d < b.d) return;
  swap(a, b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int y, m, d, ty, tm, td, cnt = 0;
  date_t a, b;
  for (int i = 0; i < 35; ++i) {
    leap[leaps[i]] = true;
  }
  scanf("%d:%d:%d", &y, &m, &d);
  scanf("%d:%d:%d", &ty, &tm, &td);
  a.y = y;
  a.m = m;
  a.d = d;
  b.y = ty;
  b.m = tm;
  b.d = td;
  cmp(a, b);
  y = a.y;
  m = a.m;
  d = a.d;
  ty = b.y;
  tm = b.m;
  td = b.d;
  for (int i = y + 1; i < ty; ++i) {
    if (leap[i])
      cnt += 366;
    else
      cnt += 365;
  }
  if (y != ty) {
    cnt += month[m] - d;
    if (leap[y] && m == 2) {
      ++cnt;
    }
    for (int i = m + 1; i <= 12; ++i) {
      cnt += month[i];
      if (leap[y] && i == 2) {
        ++cnt;
      }
    }
    cnt += td;
    for (int i = 1; i < tm; ++i) {
      cnt += month[i];
      if (leap[ty] && i == 2) {
        ++cnt;
      }
    }
  } else {
    for (int i = m + 1; i < tm; ++i) {
      cnt += month[i];
      if (leap[y] && i == 2) {
        ++cnt;
      }
    }
    if (m == tm) {
      cnt += td - d;
    } else {
      cnt += month[m] - d;
      if (leap[y] && m == 2) ++cnt;
      cnt += td;
    }
  }
  cout << cnt << "\n";
  return 0;
}
