#include <bits/stdc++.h>
using namespace std;
class Date {
 public:
  int y, m, d;
  static const int Month[2][12];
  Date(int y, int m, int d) {
    this->y = y;
    this->m = m;
    this->d = d;
  }
  Date() {
    y = 1;
    m = 1;
    d = 1;
  };
  void setDate(int y, int m, int d) {
    this->y = y;
    this->m = m;
    this->d = d;
  }
  void addD() {
    d++;
    if (d > getM()) {
      d = 1;
      addM();
    }
  }
  void addM() {
    m++;
    if (m > 12) {
      m = 1;
      y++;
    }
  }
  int getM() {
    int u = (JudgUru(y) ? 1 : 0);
    return Month[u][m - 1];
  }
  static bool JudgUru(int y) {
    if (y % 400 == 0) {
      return true;
    } else if (y % 100 == 0) {
      return false;
    } else if (y % 4 == 0) {
      return true;
    }
    return false;
  }
  int comp(Date d) {
    if (d.y == this->y && d.m == this->m && d.d == this->d) {
      return 0;
    }
    if (this->y > d.y) {
      return 1;
    } else if (this->y < d.y) {
      return -1;
    }
    if (this->m > d.m) {
      return 1;
    } else if (this->m < d.m) {
      return -1;
    }
    if (this->d > d.d) {
      return 1;
    }
    return -1;
  }
  void disp() { cout << y << ":" << m << ":" << d << endl; }
};
const int Date::Month[2][12] = {
    {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
    {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
int main(void) {
  Date s, e;
  {
    Date t1, t2;
    char buf;
    cin >> t1.y >> buf >> t1.m >> buf >> t1.d;
    cin >> t2.y >> buf >> t2.m >> buf >> t2.d;
    if (t1.comp(t2) == -1) {
      s = t1;
      e = t2;
    } else if (t1.comp(t2) == 1) {
      s = t2;
      e = t1;
    }
  }
  int res = 0;
  while (s.comp(e)) {
    res++;
    s.addD();
  }
  cout << res << endl;
  return 0;
}
