#include <bits/stdc++.h>
using namespace std;
int main() {
  int y1, y2, m1, m2, d1, d2;
  char c;
  cin >> y1 >> c >> m1 >> c >> d1;
  cin >> y2 >> c >> m2 >> c >> d2;
  int vis = 0;
  for (int y = y1; y < y2; y++)
    if (y % 4 == 0 && y != 1900) vis++;
  for (int y = y2; y < y1; y++)
    if (y % 4 == 0 && y != 1900) vis++;
  int ans = fabs(y2 - y1) * 365 + vis;
  int md[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int day1 = 0;
  for (int m = 1; m < m1; m++) day1 += md[m];
  day1 += d1;
  if (y1 % 4 == 0 && y1 != 1900)
    if (m1 > 2) day1++;
  int day2 = 0;
  for (int m = 1; m < m2; m++) day2 += md[m];
  day2 += d2;
  if (y2 % 4 == 0 && y2 != 1900)
    if (m2 > 2) day2++;
  if (y1 < y2 || (y1 == y2 && m1 < m2) || (y1 == y2 && m1 == m2 && d1 < d2))
    cout << ans - day1 + day2 << endl;
  else
    cout << ans + day1 - day2 << endl;
  return 0;
}
