#include <bits/stdc++.h>
using namespace std;
struct Date {
  int y, m, d;
};
const int monthDays[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int countLeapYears(Date d) {
  int years = d.y;
  if (d.m <= 2) years--;
  return years / 4 - years / 100 + years / 400;
}
int getDifference(Date dt1, Date dt2) {
  long int n1 = dt1.y * 365 + dt1.d;
  for (int i = 0; i < dt1.m - 1; i++) n1 += monthDays[i];
  n1 += countLeapYears(dt1);
  long int n2 = dt2.y * 365 + dt2.d;
  for (int i = 0; i < dt2.m - 1; i++) n2 += monthDays[i];
  n2 += countLeapYears(dt2);
  return (n2 - n1);
}
int main() {
  int y1, y2, m1, m2, d1, d2;
  char ch1, ch2, ch3, ch4;
  int tmp;
  cin >> y1 >> ch1 >> m1 >> ch2 >> d1;
  cin >> y2 >> ch3 >> m2 >> ch4 >> d2;
  if ((y1 > y2) || (y1 == y2 && m1 > m2) || (y1 == y2 && m1 == m2 && d1 > d2)) {
    tmp = y1;
    y1 = y2;
    y2 = tmp;
    tmp = m1;
    m1 = m2;
    m2 = tmp;
    tmp = d1;
    d1 = d2;
    d2 = tmp;
  }
  Date dt1 = {y1, m1, d1};
  Date dt2 = {y2, m2, d2};
  cout << getDifference(dt1, dt2) << endl;
  return 0;
}
