object Main extends App {
    val in = io.Source.stdin.getLines.map(_.split(" ").map(_.toInt))
    val days = List(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
    val days2 = List(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
    for (Array(y1, m1, d1, y2, m2, d2) <- in if y1 != -1) {
        val tmp = (y1 to y2).flatMap(y =>
            if (y % 4 == 0 && y % 100 != 0 || y % 1000 == 0) days2
            else days
        )
        println(tmp.drop(m1-1).dropRight(13-m2).sum - d1 + d2)
    }
}