1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
const
pow5: array[2..25] of qword = (25, 125, 625, 3125, 15625, 78125, 390625,
1953125, 9765625, 48828125, 244140625,
1220703125, 6103515625, 30517578125,
152587890625, 762939453125, 3814697265625,
19073486328125, 95367431640625,
476837158203125, 2384185791015625,
11920928955078125, 59604644775390625,
298023223876953125);
var
n, count: qword;
i: byte;
begin
readln(n);
count := n div 5;
for i := 2 to 25 do
count := count + n div pow5[i] * (i - 1);
writeln(count)
end.
|