#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)(1e5) + 100;
const int INF = (1 << 30);
const double PI = acos(-1.0);
const double EPS = (1e-6);
bool visokos(int x) {
  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0) return 1;
  return 0;
}
int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  int h1, m1, d1, h2, m2, d2, ans = 0, day1 = 0, day2 = 0;
  char x;
  cin >> h1 >> x >> m1 >> x >> d1;
  cin >> h2 >> x >> m2 >> x >> d2;
  for (int i = 1; i < h1; i++)
    if (visokos(i))
      day1 += 366;
    else
      day1 += 365;
  for (int i = 1; i < m1; i++)
    if (i == 2)
      if (visokos(h1))
        day1 += 29;
      else
        day1 += 28;
    else
      day1 += a[i - 1];
  day1 += d1;
  for (int i = 1; i < h2; i++)
    if (visokos(i))
      day2 += 366;
    else
      day2 += 365;
  for (int i = 1; i < m2; i++)
    if (i == 2)
      if (visokos(h2))
        day2 += 29;
      else
        day2 += 28;
    else
      day2 += a[i - 1];
  day2 += d2;
  cout << abs(day2 - day1);
  return 0;
}
