#include <bits/stdc++.h>
using namespace std;
int n, arr[10005], res = 0;
int main() {
  string s1, s2, s;
  cin >> s1 >> s2;
  for (int i = 0; i < 4; i++) s += s1[i];
  long long y = stoll(s);
  s.clear();
  for (int i = 5; i < 7; i++) s += s1[i];
  long long m = stoll(s);
  s.clear();
  for (int i = 8; i < 10; i++) s += s1[i];
  long long d = stoll(s);
  s.clear();
  for (int i = 0; i < 4; i++) s += s2[i];
  long long y1 = stoll(s);
  s.clear();
  for (int i = 5; i < 7; i++) s += s2[i];
  long long m1 = stoll(s);
  s.clear();
  for (int i = 8; i < 10; i++) s += s2[i];
  long long d1 = stoll(s);
  if (y > y1 || (y == y1 && m > m1) || (y == y1 && m == m1 && d > d1)) {
    swap(y, y1);
    swap(d, d1);
    swap(m, m1);
  }
  for (int i = y + 1; i < y1; i++) {
    if ((i % 4 == 0 && i % 400 == 0) ||
        (i % 4 == 0 && i % 400 == 0 && i % 100 == 0) ||
        (i % 4 == 0 && i % 100 != 0))
      res += 366;
    else
      res += 365;
  }
  if (y == y1 && m == m1 && d == d1) return cout << 0, 0;
  if (y == y1 && m == m1) return cout << d1 - d, 0;
  if (y == y1) {
    res = 0;
    if ((y1 % 4 == 0 && y1 % 400 == 0) || (y1 % 4 == 0 && y1 % 100 != 0) ||
        (y1 % 4 == 0 && y1 % 400 == 0 && y1 % 100 == 0)) {
      int tmp = m + 1;
      {
        if (m == 4 || m == 6 || m == 9 || m == 11)
          res += 31 - d;
        else if (m == 2)
          res += 30 - d;
        else
          res += 32 - d;
      }
      while (tmp < m1) {
        if (tmp == 4 || tmp == 6 || tmp == 9 || tmp == 11)
          res += 30;
        else if (tmp == 2)
          res += 29;
        else
          res += 31;
        tmp++;
      }
      if (m != m1) res += d1 - 1;
    } else {
      {
        if (m == 4 || m == 6 || m == 9 || m == 11)
          res += 31 - d;
        else if (m == 2)
          res += 29 - d;
        else
          res += 32 - d;
      }
      int tmp = m + 1;
      while (tmp < m1) {
        if (tmp == 4 || tmp == 6 || tmp == 9 || tmp == 11)
          res += 30;
        else if (tmp == 2)
          res += 28;
        else
          res += 31;
        tmp++;
      }
      if (m != m1) res += d1 - 1;
    }
    return cout << res << endl, 0;
  }
  if ((y % 4 == 0 && y % 400 == 0) || (y % 4 == 0 && y % 100 != 0) ||
      (y % 4 == 0 && y % 400 == 0 && y % 100 == 0)) {
    while (m <= 12) {
      if (m == 4 || m == 6 || m == 9 || m == 11)
        res += (31 - d);
      else if (m == 2)
        res += (30 - d);
      else
        res += (32 - d);
      m++;
      d = 1;
    }
  } else {
    while (m <= 12) {
      if (m == 4 || m == 6 || m == 9 || m == 11)
        res += (31 - d);
      else if (m == 2)
        res += (29 - d);
      else
        res += (32 - d);
      m++;
      d = 1;
    }
  }
  if ((y1 % 4 == 0 && y1 % 400 == 0) || (y1 % 4 == 0 && y1 % 100 != 0) ||
      (y1 % 4 == 0 && y1 % 400 == 0 && y1 % 100 == 0)) {
    int tmp = 1;
    while (tmp < m1) {
      if (tmp == 4 || tmp == 6 || tmp == 9 || tmp == 11)
        res += 30;
      else if (tmp == 2)
        res += 29;
      else
        res += 31;
      tmp++;
    }
    res += d1 - 1;
  } else {
    int tmp = 1;
    while (tmp < m1) {
      if (tmp == 4 || tmp == 6 || tmp == 9 || tmp == 11)
        res += 30;
      else if (tmp == 2)
        res += 28;
      else
        res += 31;
      tmp++;
    }
    res += d1 - 1;
  }
  cout << res << endl;
  return 0;
}
