#include <bits/stdc++.h>
using namespace std;
int sD, sM, sY, eD, eM, eY;
int dayes[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main(int argc, char **argv) {
  scanf("%d:%d:%d", &sY, &sM, &sD);
  scanf("%d:%d:%d", &eY, &eM, &eD);
  if (sY > eY || (sY == eY && sM > eM) || (sY == eY && sM == eM && sD > eD)) {
    swap(sY, eY);
    swap(sM, eM);
    swap(sD, eD);
  }
  int res = 0;
  for (int i = sY; i <= eY; ++i) {
    if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) dayes[1] = 29;
    int s = 0, e = 11;
    if (i == sY) {
      s = sM - 1;
      res -= sD - 1;
    }
    if (i == eY) {
      e = eM - 1;
      res -= dayes[e] - eD + 1;
    }
    for (int j = s; j <= e; ++j) res += dayes[j];
    dayes[1] = 28;
  }
  printf("%d\n", res);
  return 0;
}
