#include <bits/stdc++.h>
using namespace std;
int ans;
int mon[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool runnian(int x) {
  bool b = 0;
  if (x % 4 == 0 && x % 100 != 0) b = 1;
  if (x % 400 == 0) b = 1;
  return b;
}
int main() {
  int a[6], ay, am, ad, by, bm, bd;
  scanf("%d:%d:%d", &a[0], &a[1], &a[2]);
  scanf("%d:%d:%d", &a[3], &a[4], &a[5]);
  if (a[0] < a[3])
    ay = a[0], by = a[3], am = a[1], bm = a[4], ad = a[2], bd = a[5];
  else if (a[0] > a[3])
    ay = a[3], by = a[0], am = a[4], bm = a[1], ad = a[5], bd = a[2];
  else if (a[1] < a[4])
    ay = a[0], by = a[3], am = a[1], bm = a[4], ad = a[2], bd = a[5];
  else if (a[1] > a[4])
    ay = a[3], by = a[0], am = a[4], bm = a[1], ad = a[5], bd = a[2];
  else if (a[2] < a[5])
    ay = a[0], by = a[3], am = a[1], bm = a[4], ad = a[2], bd = a[5];
  else
    ay = a[3], by = a[0], am = a[4], bm = a[1], ad = a[5], bd = a[2];
  for (int i = ay; i <= by; i++) {
    ans += 365;
    if (runnian(i)) ans++;
  }
  for (int i = 0; i < am - 1; i++) ans -= mon[i];
  if (runnian(ay) && am > 2) ans--;
  ans -= ad;
  int bb = 365;
  if (runnian(by)) bb++;
  for (int i = 0; i < bm - 1; i++) bb -= mon[i];
  if (runnian(by) && bm > 2) bb--;
  bb -= bd;
  ans -= bb;
  cout << ans;
  return 0;
}
