dayCount [y1,m1,d1, y2,m2,d2]
  | y1 < y2 || m1 < m2 = monLen y1 m1 + dayCount (nextMon ++ [y2,m2,d2])
  | otherwise          = d2 - d1
  where nextMon | m1 < 12   = [y1, m1+1, d1]
                | otherwise = [y1+1,  1, d1]

monLen y m
  | m == 2    = 28 + leap y
  | otherwise = [31,28,31,30,31,30,31,31,30,31,30,31] !! (m - 1)

leap y = if isLeapYear y then 1 else 0
isLeapYear y = (y `mod` 4 == 0 && y `mod` 100 /= 0) || y `mod` 400 == 0

main = do
  s <- getLine
  let ls = map read . words $ s
  if or $ map (< 0) ls
    then return ()
    else do putStrLn . show . dayCount $ ls
            main