#include <bits/stdc++.h>
using namespace std;
const int DAY[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool isLeap(int y) { return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0; }
int calc() {
  int y, m, d;
  scanf("%d:%d:%d", &y, &m, &d);
  int res = d;
  for (int i = (1900); i < (y); i++) res += isLeap(i) ? 366 : 365;
  for (int i = (0); i < (m - 1); i++) {
    res += DAY[i];
    if (i == 1) res += isLeap(y);
  }
  return res;
}
int main() {
  int d1 = calc();
  int d2 = calc();
  printf("%d\n", abs(d2 - d1));
  return 0;
}
