#include <bits/stdc++.h>
using namespace std;
long long date1[4];
long long date2[4];
bool rn[20];
int main() {
  string a, b;
  cin >> a >> b;
  long long mark1 = 1;
  long long mark2 = 1;
  for (long long i = 0; i <= a.length() - 1; i++) {
    if (a[i] == ':')
      mark1++;
    else {
      date1[mark1] = date1[mark1] * 10 + a[i] - '0';
    }
  }
  for (long long i = 0; i <= b.length() - 1; i++) {
    if (b[i] == ':')
      mark2++;
    else {
      date2[mark2] = date2[mark2] * 10 + b[i] - '0';
    }
  }
  rn[1] = 1;
  rn[2] = 0;
  rn[3] = 1;
  rn[4] = 0;
  rn[5] = 1;
  rn[6] = 0;
  rn[7] = 1;
  rn[8] = 1;
  rn[9] = 0;
  rn[10] = 1;
  rn[11] = 0;
  rn[12] = 1;
  long long sum1 = 0, sum2 = 0;
  for (long long i = 1900; i <= date1[1] - 1; i++) {
    if (i % 400 == 0)
      sum1++;
    else if (i % 4 == 0 && i % 100 != 0)
      sum1++;
    sum1 += 365;
  }
  for (long long i = 1; i <= date1[2] - 1; i++) {
    if (i == 2) {
      sum1 -= 2;
      if (date1[1] % 100 == 0 && date1[1] % 400 == 0) {
        sum1++;
      } else if (date1[1] % 4 == 0 && date1[1] % 100 != 0) {
        sum1++;
      }
    } else if (rn[i] == 1)
      sum1++;
    sum1 += 30;
  }
  sum1 += date1[3];
  for (long long i = 1900; i <= date2[1] - 1; i++) {
    if (i % 400 == 0)
      sum2++;
    else if (i % 4 == 0 && i % 100 != 0)
      sum2++;
    sum2 += 365;
  }
  for (long long i = 1; i <= date2[2] - 1; i++) {
    if (i == 2) {
      sum2 -= 2;
      if (date2[1] % 100 == 0 && date2[1] % 400 == 0)
        sum2++;
      else if (date2[1] % 4 == 0 && date2[1] % 100 != 0)
        sum2++;
    } else if (rn[i] == 1)
      sum2++;
    sum2 += 30;
  }
  sum2 += date2[3];
  cout << abs(sum1 - sum2) << endl;
  return 0;
}
