"""

dp[v][x][s] = v番目まで見て、1をx個置き、そのindexの総和がsの場合の数

"""

import sys
from sys import stdin

S = list(stdin.readline()[:-1])
N = len(S)

indsum = 0
onenum = 0
for i in range(N):
    if S[i] == "1":
        indsum += i
        onenum += 1

dp = [[[0] * (indsum+1) for i in range(onenum+1)] for j in range(N)]

if onenum == 0:
    print (1)
    sys.exit()

dp[0][0][0] = 1
dp[0][1][0] = 1

for i in range(1,N):
    for j in range(onenum+1):
        for k in range(indsum+1):

            #0を置く場合 1,indsumは変化なし
            dp[i][j][k] += dp[i-1][j][k]

            #1を置く場合
            if j-1 >= 0 and k-i >= 0:
                dp[i][j][k] += dp[i-1][j-1][k-i]

print (dp[-1][-1][-1])