DOM = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

def leap?(y)
  return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0)
end

def doy(y, m, d)
  sum = d
  for i in (1...m)
    sum += DOM[i]
  end
  sum += 1 if m > 2 && leap?(y)

  return sum
end

while true
  y1, m1, d1, y2, m2, d2 = gets.chomp.split(" ").map{|s| s.to_i}
  break if y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0

  days = doy(y2, m2, d2) - doy(y1, m1, d1)
  for y in (y1...y2)
    days += leap?(y) ? 366 : 365
  end

  puts days
end