def leap(y)
  if y % 400 == 0
    1
  elsif y % 100 == 0
    0
  elsif y % 4 == 0
    1
  else
    0
  end
end

$month = [0, 31, [28, 29], 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

def add_day(y, m, y1, m1, d1, y2, m2, d2)
  if y1 == y2 && m1 == m2
    d2 - d1
  elsif m == m1 && y == y1
    if m == 2
      $month[2][leap(y)] - d1 + 1
    else
      $month[m] - d1 + 1
    end
  elsif m == m2 && y == y2
    d2 - 1
  else
    if m == 2
      $month[2][leap(y)]
    else
      $month[m]
    end
  end
end

loop do
  data = gets.chomp.split.map(&:to_i)
  break if data.all?{ |x| x == -1 }

  y1, m1, d1, y2, m2, d2 = data
  count = 0
  
  y1.upto(y2) do |y|
    if y1 == y2
      m1.upto(m2) { |m| count += add_day(y, m, *data) }
    elsif y1 == y
      m1.upto(12) { |m| count += add_day(y, m, *data) }
    elsif y2 == y
      1.upto(m2) { |m| count += add_day(y, m, *data) }
    else
      1.upto(12) { |m| count += add_day(y, m, *data) }
    end
  end
  puts count
end