#include <bits/stdc++.h>
using namespace std;
int date[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int d, m, y;
int d1, m1, y2;
void next_day() {
  int pp = 28;
  d++;
  if (m != 2) {
    if (d > date[m]) {
      d = 1;
      m++;
    }
    if (m > 12) {
      m = 1;
      y++;
    }
  } else {
    if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) pp = 29;
    if (d > pp) {
      d = 1;
      m++;
    }
  }
  return;
}
signed main() {
  char a, b;
  scanf("%d%c%d%c%d", &y, &a, &m, &b, &d);
  char a1, b1;
  scanf("%d%c%d%c%d", &y2, &a1, &m1, &b1, &d1);
  if (y > y2 || (y == y2 && m > m1) || (y == y2 && m == m1 && d > d1)) {
    swap(y, y2);
    swap(m, m1);
    swap(d, d1);
  }
  int ans = 0;
  for (; d != d1 || m != m1 || y != y2; ans++) next_day();
  cout << ans;
  return 0;
}
