#include <bits/stdc++.h>
using namespace std;
int leap(int y) {
  if (y % 4) return 0;
  if (y % 100 == 0 && y % 400) return 0;
  return 1;
}
int main() {
  int mons[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int y1, m1, d1, y2, m2, d2;
  char c;
  cin >> y1 >> c >> m1 >> c >> d1 >> y2 >> c >> m2 >> c >> d2;
  int ans1 = 0, ans2 = 0;
  ans1 += d1;
  ans2 += d2;
  for (int i = y1 - 1; i >= 1; i--) {
    ans1 += 365;
    if (leap(i)) {
      ans1++;
    }
  }
  for (int i = m1 - 1; i >= 1; i--) {
    ans1 += mons[i];
  }
  if (m1 > 2) {
    if (leap(y1)) {
      ans1++;
    }
  }
  for (int i = y2 - 1; i >= 1; i--) {
    ans2 += 365;
    if (leap(i)) {
      ans2++;
    }
  }
  for (int i = m2 - 1; i >= 1; i--) {
    ans2 += mons[i];
  }
  if (m2 > 2) {
    if (leap(y2)) {
      ans2++;
    }
  }
  cout << abs(ans1 - ans2) << endl;
  return 0;
}
