#include <bits/stdc++.h>
using namespace std;
int ya, yb, ma, mb, da, db;
int ans;
int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  scanf("%d:%d:%d", &ya, &ma, &da);
  scanf("%d:%d:%d", &yb, &mb, &db);
  if (ya > yb) {
    int t = ya;
    ya = yb;
    yb = t;
    t = ma;
    ma = mb;
    mb = t;
    t = da;
    da = db;
    db = t;
  }
  if (ya == yb && ma > mb) {
    int t = ya;
    ya = yb;
    yb = t;
    t = ma;
    ma = mb;
    mb = t;
    t = da;
    da = db;
    db = t;
  }
  if (ya == yb && ma == mb && da > db) {
    int t = ya;
    ya = yb;
    yb = t;
    t = ma;
    ma = mb;
    mb = t;
    t = da;
    da = db;
    db = t;
  }
  for (int i = ya; i < yb; i++) {
    ans += 365;
    if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0)) ans++;
  }
  int f = 0;
  if ((ya % 4 == 0 && ya % 100 != 0) || (ya % 400 == 0)) f = 1;
  for (int i = 1; i < ma; i++) {
    ans -= month[i];
    if (i == 2) ans -= f;
  }
  ans -= da - 1;
  f = 0;
  if ((yb % 4 == 0 && yb % 100 != 0) || (yb % 400 == 0)) f = 1;
  for (int i = 1; i < mb; i++) {
    ans += month[i];
    if (i == 2) ans += f;
  }
  ans += db;
  cout << ans - 1;
  return 0;
}
