#include <bits/stdc++.h>
using namespace std;
const long long nInf = -1000000000;
const long long pInf = 1000000000;
const long long mod = 1000000007;
const int MAXN = 1000;
void getdata();
void preproc();
void solve();
int y11, y2, m1, m2, d1, d2;
int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int countdays(int y, int m, int d);
int main() {
  int t = 1;
  for (int i = 0; i < t; i++) {
    getdata();
    preproc();
    solve();
  }
  return 0;
}
void getdata() {
  scanf("%d:%d:%d", &y11, &m1, &d1);
  scanf("%d:%d:%d", &y2, &m2, &d2);
}
void preproc() {}
void solve() {
  int am1 = countdays(y11, m1, d1);
  int am2 = countdays(y2, m2, d2);
  printf("%d\n", abs(am1 - am2));
}
bool leap(int y) {
  if (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)) return true;
  return false;
}
int countdays(int y, int m, int d) {
  int count = 0;
  for (int i = 0; i < y; i++) {
    if (leap(i)) {
      count += 366;
    } else {
      count += 365;
    }
  }
  for (int i = 1; i < m; i++) {
    if (i == 2 && leap(y)) count++;
    count += month[i];
  }
  count += d;
  return count;
}
