#include <bits/stdc++.h>
using namespace std;
int leapyear(int i) {
  if (i % 4 == 0 && i % 100 != 0) return 1;
  if (i % 400 == 0)
    return 1;
  else
    return 0;
}
int daysofyears(int y, int m, int d) {
  int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int res = 0;
  for (int i = 1900; i < y; i++) {
    res += 365;
    res += leapyear(i);
  }
  for (int i = 0; i < m; i++) res += month[i];
  if (m > 2) res += leapyear(y);
  res += d;
  return res;
}
int main() {
  int y1, y2, m1, m2, d1, d2, res, daysofyear1, daysofyear2;
  scanf("%d:%d:%d", &y1, &m1, &d1);
  scanf("%d:%d:%d", &y2, &m2, &d2);
  daysofyear1 = daysofyears(y1, m1, d1);
  daysofyear2 = daysofyears(y2, m2, d2);
  res = daysofyear1 - daysofyear2;
  if (res < 0) res = 0 - res;
  cout << res;
  return 0;
}
