#include <bits/stdc++.h>
using namespace std;
bool isleap(int y) {
  if (y % 100 == 0) {
    return y % 400 == 0;
  } else
    return y % 4 == 0;
}
int mday[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int cal(int y, int m, int d) {
  int res = 0;
  for (int i = 1900; i < y; i++) {
    if (isleap(i))
      res += 366;
    else
      res += 365;
  }
  for (int i = 1; i < m; i++) {
    if (i == 2) {
      if (isleap(y))
        res += 29;
      else
        res += 28;
    } else
      res += mday[i];
  }
  res += d;
  return res;
}
int main() {
  int y, m, d;
  int yy, mm, dd;
  scanf("%d:%d:%d", &yy, &mm, &dd);
  scanf("%d:%d:%d", &y, &m, &d);
  int d1 = cal(yy, mm, dd);
  int d2 = cal(y, m, d);
  if (d1 > d2) swap(d1, d2);
  cout << d2 - d1 << endl;
  return 0;
}
