#include <bits/stdc++.h>
using namespace std;
const int d[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main(void) {
  int sy, sm, sd;
  int ty, tm, td;
  int t, o;
  scanf("%d:%d:%d", &sy, &sm, &sd);
  scanf("%d:%d:%d", &ty, &tm, &td);
  if (ty < sy || (ty == sy && tm < sm) || (ty == sm && tm == sm && td < sd)) {
    swap(sy, ty);
    swap(sm, tm);
    swap(sd, td);
  }
  for (o = 0; sy != ty || sm != tm || sd != td; o++) {
    t = sm != 2 ? d[sm] : ((!(sy & 3) && (sy % 100)) || !(sy % 400) ? 29 : 28);
    if (sd++ == t) {
      sd = 1;
      if (sm++ == 12) {
        sm = 1;
        ++sy;
      }
    }
  }
  printf("%d\n", o);
  return 0;
}
