program double_fractorial
    implicit none
    integer(8):: n, md, zero_num, keta
    read*, n

    if (mod(n,2) /= 0) then
        print*, 0
        stop
    end if

    n=n/10
    zero_num = 0
    keta = 1
    do while(n > 0)
        if (mod(n,10) /= 0) then
            zero_num = zero_num + calc_zero_num(mod(n,10), keta)
        end if
        n=n/10
        keta=keta+1
    end do

    print*, zero_num

contains
function calc_zero_num(md, keta) result(ret)
    integer(8):: md, keta,ret, nk
    nk = keta
    ret = 0
    do while(nk > 0)
        ! print*, md, keta
        ret = ret + md*10**(nk-1)
        nk=nk-1
    end do
end function
end program double_fractorial