#include <bits/stdc++.h>
using namespace std;
int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int days(int y, int m, int d) {
  int x = 0, mnt = 0;
  if (y == 1900)
    x = 0;
  else
    x = (y - 1901) / 4;
  y = (y - 1900);
  for (int i = 1; i < m; i++) mnt += a[i];
  if ((y != 0) && (y % 4 == 0) && (m > 2)) x++;
  return y * 365 + mnt + d + x;
}
int main() {
  int y, m, d, Y, M, D;
  scanf("%d:%d:%d", &y, &m, &d);
  scanf("%d:%d:%d", &Y, &M, &D);
  cout << abs(days(y, m, d) - days(Y, M, D));
}
