#include <bits/stdc++.h>
int32_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};
bool is_leap(int32_t y) { return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0; }
int32_t read_date() {
  int32_t y, m, d;
  char c;
  std::cin >> y >> c >> m >> c >> d;
  for (int32_t i = 1; i < y; ++i) {
    d += 365 + is_leap(i);
  }
  for (int32_t i = 0; i + 1 < m; ++i) {
    if (i == 1 && is_leap(y)) {
      d += 1;
    }
    d += months[i];
  }
  return d;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout << std::abs(read_date() - read_date()) << '\n';
}
