#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double eps = 1e-9;
template <class T>
T Abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
string toString(T n) {
  ostringstream ost;
  ost << n;
  ost.flush();
  return ost.str();
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T sqr(T n) {
  return n * n;
}
template <class T>
T power(T n, T p) {
  if (!p)
    return 1;
  else {
    T sum = sqr(power(n, p >> 1));
    if (p & 1) sum = n;
    return sum;
  }
}
long long bigmod(long long num, long long p, long long mod) {
  long long sum = 1, temp = num;
  while (p) {
    if (p & 1) sum = (sum * temp) % mod;
    temp = (temp * temp) % mod;
    p = p >> 1;
  }
  return sum;
}
bool bit_check(int k, int p) { return (bool)(k & (1 << p)); }
int bit_set(int k, int p) { return k = (k | (1 << p)); }
int day_in_month(int year, int mon) {
  if (((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))) {
    if (mon == 1) return 31;
    if (mon == 2) return 29;
    if (mon == 3) return 31;
    if (mon == 4) return 30;
    if (mon == 5) return 31;
    if (mon == 6) return 30;
    if (mon == 7) return 31;
    if (mon == 8) return 31;
    if (mon == 9) return 30;
    if (mon == 10) return 31;
    if (mon == 11) return 30;
    if (mon == 12) return 31;
  } else {
    if (mon == 1) return 31;
    if (mon == 2) return 28;
    if (mon == 3) return 31;
    if (mon == 4) return 30;
    if (mon == 5) return 31;
    if (mon == 6) return 30;
    if (mon == 7) return 31;
    if (mon == 8) return 31;
    if (mon == 9) return 30;
    if (mon == 10) return 31;
    if (mon == 11) return 30;
    if (mon == 12) return 31;
  }
}
int main() {
  char ch;
  int sum = 0;
  int y1, m1, d1, y2, m2, d2;
  cin >> y1 >> ch >> m1 >> ch >> d1;
  cin >> y2 >> ch >> m2 >> ch >> d2;
  if (y1 > y2) {
    swap(y1, y2);
    swap(m1, m2);
    swap(d1, d2);
  }
  if (y1 == y2) {
    if (m1 > m2) {
      swap(m1, m2);
      swap(d1, d2);
    } else if (m1 == m2) {
      if (d1 > d2) swap(d1, d2);
      if (d1 == d2) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  while (true) {
    if (y1 == y2 && d1 == d2 && m1 == m2) {
      cout << sum << endl;
      return 0;
    }
    sum++;
    d1++;
    if (d1 > day_in_month(y1, m1)) {
      d1 = 1;
      m1++;
      if (m1 > 12) {
        m1 = 1;
        y1++;
      }
    }
  }
  return 0;
}
