#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline string tostring(const T& x) {
  ostringstream os;
  os << x;
  return os.str();
}
inline int toint(const string& s) {
  istringstream is(s);
  int x;
  is >> x;
  return x;
}
inline int todecimal(string s) {
  int a = 0;
  for (int i = 0; i < s.size(); i++) a = 2 * a + (s[i] - '0');
  return a;
}
inline string tobinary(int a) {
  string s;
  while (a != 0) {
    s = (char)(a % 2 + '0') + s;
    a >>= 1;
  }
  return s;
}
inline void inp(int& n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
int year1, day1, month1;
int year2, day2, month2;
int is_leap_year(int y) {
  if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) return 1;
  return 0;
}
void solve() {
  if (year1 > year2) {
    swap(year1, year2);
    swap(month1, month2);
    swap(day1, day2);
  } else if (year1 == year2) {
    if (month1 > month2) {
      swap(month1, month2);
      swap(day1, day2);
    } else if (month1 == month2) {
      if (day1 > day2) swap(day1, day2);
    }
  }
  int ans = 0;
  for (int i = year1 + 1; i < year2; i++) {
    if (is_leap_year(i))
      ans += 366;
    else
      ans += 365;
  }
  int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  for (int i = month1 + 1; i <= 12; i++) ans += days[i - 1];
  for (int i = 1; i < month2; i++) ans += days[i - 1];
  ans += days[month1 - 1] - day1 + 1;
  if (is_leap_year(year1) && month1 <= 2) ans++;
  ans += day2;
  if (is_leap_year(year2) && month2 > 2) ans++;
  if (year1 == year2) {
    ans -= 365 + is_leap_year(year1);
  }
  cout << ans - 1 << endl;
}
void input() {
  char ch;
  cin >> year1 >> ch >> month1 >> ch >> day1;
  cin >> year2 >> ch >> month2 >> ch >> day2;
}
int main() {
  int testcase = 1;
  for (int i = 0; i < testcase; i++) {
    input();
    solve();
  }
  return 0;
}
