#include <bits/stdc++.h>
using namespace std;
int m1[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int m[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool leap(int x) {
  if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0)) return 1;
  return 0;
}
int main() {
  int sx, sy, sz;
  int ex, ey, ez;
  int x, y, z, ans = 0;
  scanf("%d:%d:%d", &sx, &sy, &sz);
  scanf("%d:%d:%d", &ex, &ey, &ez);
  int t;
  if (sx > ex) {
    t = sx;
    sx = ex;
    ex = t;
    sy ^= ey ^= sy ^= ey;
    sz ^= ez ^= sz ^= ez;
  } else if ((sx == ex) && (sy > ez)) {
    t = sx;
    sx = ex;
    ex = t;
    sy ^= ey ^= sy ^= ey;
    sz ^= ez ^= sz ^= ez;
  } else if ((sx == ex) && (sy == ey) && (sz > ez)) {
    t = sx;
    sx = ex;
    ex = t;
    sy ^= ey ^= sy ^= ey;
    sz ^= ez ^= sz ^= ez;
  }
  if (sy != 2)
    ans += m[sy - 1] - sz;
  else {
    if (leap(sx))
      ans += m[sy - 1] - sz;
    else
      ans += m1[sy - 1] - sz;
  }
  if (leap(sx) && sy <= 2) {
    for (int i = sy; i <= 11; i++) ans += m[i];
  }
  if (leap(sx) && sy > 2) {
    for (int i = sy; i <= 11; i++) ans += m[i];
  }
  if ((leap(sx) == 0) && sy <= 2) {
    for (int i = sy; i <= 11; i++) ans += m1[i];
  }
  if ((leap(sx) == 0) && sy > 2) {
    for (int i = sy; i <= 11; i++) ans += m1[i];
  }
  for (int i = sx + 1; i < ex; i++) {
    if (leap(i))
      ans += 366;
    else
      ans += 365;
  }
  if (leap(ex) && ey > 2) {
    for (int i = 0; i < ey - 1; i++) ans += m[i];
  }
  if ((leap(ex) == 0) && ey > 2) {
    for (int i = 0; i < ey - 1; i++) ans += m1[i];
  }
  if (leap(ex) && ey <= 2) {
    for (int i = 0; i < ey - 1; i++) ans += m[i];
  }
  if ((leap(ex) == 0) && ey <= 2) {
    for (int i = 0; i < ey - 1; i++) ans += m1[i];
  }
  if (sx == ex) {
    if (leap(ex))
      ans -= 366;
    else
      ans -= 365;
  }
  ans += ez;
  cout << abs(ans) << endl;
  return 0;
}
