#include <bits/stdc++.h>
using namespace std;
int a[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
inline bool runnian(int x) {
  return (x % 4 == 0 && x % 100 != 0) || x % 400 == 0;
}
inline int get(int y, int m, int d) {
  int ret = 0;
  for (int i = 1900; i < y; i++) {
    ret += 365;
    if (runnian(i)) ret++;
  }
  for (int i = 0; i < m - 1; i++) ret += a[i];
  ret += d;
  if (runnian(y) && m > 2) ret++;
  return ret;
}
int main() {
  int ay, am, ad, by, bm, bd;
  scanf("%d:%d:%d", &ay, &am, &ad);
  scanf("%d:%d:%d", &by, &bm, &bd);
  cout << abs(get(ay, am, ad) - get(by, bm, bd));
  return 0;
}
