#include <bits/stdc++.h>
using namespace std;
template <class T>
void pp(T v) {
  for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
    cout << *it << ' ';
  cout << endl;
}
template <class T>
void pp(T v, int n) {
  for (int i = 0; i < (int)n; i++) cout << v[i] << ' ';
  cout << endl;
}
template <class T>
inline void chmax(T &a, const T b) {
  a = max(a, b);
}
template <class T>
inline void chmin(T &a, const T b) {
  a = min(a, b);
}
const int INF = 1 << 28;
const double EPS = 1.0e-9;
static const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
bool isleap(const int y) {
  if (y % 4 != 0) return false;
  if (y % 400 == 0) return true;
  if (y % 100 == 0)
    return false;
  else
    return true;
}
int getdays(const int y, const int m, const int d) {
  const int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int ret = 0;
  for (int yy = 1900; yy < y; yy++) {
    ret += 365;
    if (isleap(yy)) ret++;
  }
  for (int mm = 1; mm < m; mm++) {
    if (mm == 2) {
      ret += (isleap(y) ? 1 : 0);
    }
    ret += days[mm];
  }
  ret += d;
  return ret;
}
int main(void) {
  int y1, m1, d1;
  int y2, m2, d2;
  scanf("%d:%d:%d", &y1, &m1, &d1);
  scanf("%d:%d:%d", &y2, &m2, &d2);
  int ans = getdays(y1, m1, d1) - getdays(y2, m2, d2);
  cout << abs(ans) << endl;
  return 0;
}
