#include <bits/stdc++.h>
using namespace std;
const int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
long long y, m, d, a, b, c;
bool leap(int v) { return ((v % 400 == 0) || (v % 4 == 0 && v % 100 != 0)); }
int getday(int yy, int mm, int dd) {
  int ans = 0;
  for (int v = 1900; v < yy; v++) ans += 365 + leap(v);
  for (int v = 1; v < mm; v++) ans += month[v] + (v == 2 && leap(yy));
  return ans + dd;
}
int main() {
  scanf("%d:%d:%d", &y, &m, &d);
  scanf("%d:%d:%d", &a, &b, &c);
  cout << abs(getday(y, m, d) - getday(a, b, c));
  return 0;
}
