PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000215. Chữ số 0 cuối của giai thừa kép (Double Factorial)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Chữ số 0 cuối của giai thừa kép (Double Factorial)

Double Factorial

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Define f(n)f(n) for nonnegative integers by

$$f(n)=\begin{cases}1,&0\le n<2,\\n\cdot f(n-2),&n\ge2.\end{cases}$$

Thus f(n)f(n) is the product of positive integers with the same parity as nn, starting at nn and decreasing in steps of 22.

Given NN, find the number of trailing zero digits in the decimal representation of f(N)f(N).

Input

The only line contains the integer NN.

Output

Print one integer: the number of trailing zeros of f(N)f(N).

Subtasks

  • Subtask 1 (20 points): 0≤N≤1000\le N\le 100.
  • Subtask 2 (30 points): 0≤N≤1090\le N\le 10^9.
  • Subtask 3 (50 points): 0≤N≤10180\le N\le 10^{18}.

Examples

Input

12

Output

1

Explanation

The factors are 12,10,8,6,4,212,10,8,6,4,2, so f(12)=46080f(12)=46080, which has one trailing zero. Equivalently, N/2=6N/2=6 and the exponent of 55 in 6!6! is ⌊6/5⌋=1\lfloor6/5\rfloor=1. Thus the answer is 11.