#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, pair<int, int> >, vector<pair<int, pair<int, int> > >,
               less<pair<int, pair<int, int> > > >
    dis;
int mm[] = {32, 29, 32, 31, 32, 31, 32, 32, 31, 32, 31, 32};
int main() {
  int y[10], m[10], d[10], sum = 0, ll = 29;
  for (int i = 1; i <= 2; i++) {
    scanf("%d:%d:%d", &y[i], &m[i], &d[i]);
    dis.push(pair<int, pair<int, int> >(y[i], pair<int, int>(m[i], d[i])));
  }
  for (int i = 1; i <= 2; i++) {
    y[i] = dis.top().first;
    m[i] = dis.top().second.first;
    d[i] = dis.top().second.second;
    dis.pop();
  }
  int leap = 0;
  if (y[2] % 400 == 0) leap = 1;
  if (y[2] % 4 == 0 && y[2] % 100 != 0) leap = 1;
  mm[1] = ll + leap;
  for (;;) {
    if (y[1] == y[2] && d[1] == d[2] && m[1] == m[2]) break;
    d[2] = (d[2] + 1) % mm[m[2] - 1];
    if (d[2] == 0 || d[2] >= mm[m[2] - 1]) d[2] = 1, m[2]++;
    if (m[2] == 13) {
      m[2] = 1;
      y[2]++;
      leap = 0;
      if (y[2] % 400 == 0) leap = 1;
      if (y[2] % 4 == 0 && y[2] % 100 != 0) leap = 1;
      mm[1] = ll + leap;
    }
    sum++;
  }
  printf("%d", sum);
}
