#include <bits/stdc++.h>
using namespace std;
bool check(int N) {
  if (N % 4 == 0 && N % 100 != 0) return 1;
  if (N % 100 == 0 && N % 400 == 0) return 1;
  return 0;
}
int main() {
  int ar[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int i, j, x, y, s, e, m, d, sm, p, q;
  sm = 0;
  for (i = 1; i <= 12; i++) sm += ar[i];
  char a[20], b[20];
  cin >> a;
  cin >> b;
  d = m = s = e = 0;
  s = (a[0] - '0') + s * 10;
  s = (a[1] - '0') + s * 10;
  s = (a[2] - '0') + s * 10;
  s = (a[3] - '0') + s * 10;
  e = (b[0] - '0') + e * 10;
  e = (b[1] - '0') + e * 10;
  e = (b[2] - '0') + e * 10;
  e = (b[3] - '0') + e * 10;
  m = (a[5] - '0') + m * 10;
  m = (a[6] - '0') + m * 10;
  d = (a[8] - '0') + d * 10;
  d = (a[9] - '0') + d * 10;
  p = (b[5] - '0') + p * 10;
  p = (b[6] - '0') + p * 10;
  q = (b[8] - '0') + q * 10;
  q = (b[9] - '0') + q * 10;
  if (s > e) {
    for (i = 0; i < 10; i++) swap(a[i], b[i]);
  } else if (s == e) {
    if (m > p) {
      for (i = 0; i < 10; i++) swap(a[i], b[i]);
    } else if (m == p) {
      if (d > q) {
        for (i = 0; i < 10; i++) swap(a[i], b[i]);
      }
    }
  }
  p = q = d = m = s = e = 0;
  s = (a[0] - '0') + s * 10;
  s = (a[1] - '0') + s * 10;
  s = (a[2] - '0') + s * 10;
  s = (a[3] - '0') + s * 10;
  e = (b[0] - '0') + e * 10;
  e = (b[1] - '0') + e * 10;
  e = (b[2] - '0') + e * 10;
  e = (b[3] - '0') + e * 10;
  m = (a[5] - '0') + m * 10;
  m = (a[6] - '0') + m * 10;
  d = (a[8] - '0') + d * 10;
  d = (a[9] - '0') + d * 10;
  p = (b[5] - '0') + p * 10;
  p = (b[6] - '0') + p * 10;
  q = (b[8] - '0') + q * 10;
  q = (b[9] - '0') + q * 10;
  x = 0;
  if (s == e && m == p) {
    cout << (q - d);
    return 0;
  }
  if (m == 1) {
    x += (31 - d + 1);
  } else if (m == 2) {
    if (check(s))
      x += (29 - d + 1);
    else
      x += (28 - d + 1);
  } else {
    x += (ar[m] - d + 1);
  }
  if (s == e) {
    for (i = m + 1; i < p; i++) {
      if (i == 2) {
        if (check(i))
          x += 29;
        else
          x += 28;
      } else
        x += ar[i];
    }
    x += (q);
    cout << (x - 1);
    return 0;
  }
  for (i = m + 1; i <= 12; i++) x += ar[i];
  for (i = s + 1; i < e; i++)
    if (check(i))
      x += (sm + 1);
    else
      x += sm;
  m = d = 0;
  m = (b[5] - '0') + m * 10;
  m = (b[6] - '0') + m * 10;
  d = (b[8] - '0') + d * 10;
  d = (b[9] - '0') + d * 10;
  if (m == 1)
    x += d;
  else if (m == 2) {
    x += 31;
    x += d;
  } else {
    x += 31;
    if (check(e))
      x += 29;
    else
      x += 28;
    for (i = 3; i < m; i++) x += ar[i];
    x += d;
  }
  cout << (x - 1);
  return 0;
}
