#include <bits/stdc++.h>
using namespace std;
int a, b, c, aa, bb, cc, ans;
int ma[13] = {0, 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
void next_day() {
  int pp;
  c++;
  if (b != 2) {
    if (c > ma[b]) c = 1, b++;
  } else {
    if (a % 4 == 0 and (a % 100 != 0 or a % 400 == 0))
      pp = 29;
    else
      pp = 28;
    if (c > pp) b++, c = 1;
  }
  if (b == 13) a++, b = 1, c = 1;
}
int main() {
  scanf("%d:%d:%d", &a, &b, &c);
  scanf("%d:%d:%d", &aa, &bb, &cc);
  if (a > aa or a == aa and b > bb or a == aa and b == bb and c > cc)
    swap(aa, a), swap(bb, b), swap(cc, c);
  for (; a != aa or b != bb or c != cc; ans++) next_day();
  cout << ans--;
  return 0;
}
