import strscans let (_, a, b, c, d, e) = stdin.readAll.scanTuple"$i $i $i $i $i" let n = a * (b - c) var x = d ans = 0 for i in 1..n: if i mod 10 == 0: if x >= e: x.dec e ans.inc x continue ans.inc x echo ans