#include <bits/stdc++.h>
using namespace std;
int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool isleap(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 + isleap(v);
  for (int v = 1; v < mm; v++) ans += month[v] + (v == 2 && isleap(yy));
  return ans + dd;
}
int main() {
  int a1, a2, a3, b1, b2, b3;
  scanf("%d:%d:%d", &a1, &a2, &a3);
  scanf("%d:%d:%d", &b1, &b2, &b3);
  printf("%d\n", abs(getday(a1, a2, a3) - getday(b1, b2, b3)));
  return 0;
}
