#include <bits/stdc++.h>
void debug() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
}
int dx[]{1, -1, 0, 0};
int dy[]{0, 0, 1, -1};
using namespace std;
int Ms[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int countDays(int year, int month, int day) {
  long long s = 0;
  s += (year - 1) * 365;
  s += (year - 1) / 4;
  s += (year - 1) / 400;
  s -= (year - 1) / 100;
  s += day;
  for (int i = 0; i < month - 1; i++) {
    s += Ms[i];
  }
  if (month > 2) {
    if (year % 4 == 0) s++;
    if (year % 100 == 0) s--;
    if (year % 400 == 0) s++;
  }
  return s;
}
int main() {
  int d1, d2, m1, m2, y1, y2;
  scanf("%d:%d:%d", &y1, &m1, &d1);
  scanf("%d:%d:%d", &y2, &m2, &d2);
  cout << abs(countDays(y1, m1, d1) - countDays(y2, m2, d2)) << '\n';
}
