#include <bits/stdc++.h>
using namespace std ;
unsigned long long fib[86];
int main()
{
fib[0] = 0 , fib[1] = 1;
for (int i = 2 ; i <= 85 ; i++ )
{
fib[i] = fib[i-1] + fib[i-2];
}
cout << fib[4];
string s;
while(cin >> s)
{
unsigned long long res = 1,c = 1;
if (s == "0") break;
for (int i = 0 ; i < s.size() - 1 ; i++ )
{
int n = (s[i] - 48 )*10 + (s[i+1] - 48 );
if ( i+ 2 < s.size() && s[i+2] == '0') res *= fib[++c] , c = 1;
else if ( s[i + 1] == '0') i ++ , res *= fib[++c] , c = 1;
else if (n <= 26) c++;
else
{
res *= fib[++c] , c = 1;
}
}
int check = s.find("00");
if (check >= 0) res = 0;
cout << res * fib[++c]<< "\n";
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQgOwp1bnNpZ25lZCBsb25nIGxvbmcgZmliWzg2XTsKaW50IG1haW4oKQp7CiAgICBmaWJbMF0gPSAwICwgZmliWzFdID0gMTsKICAgIGZvciAoaW50IGkgPSAyIDsgaSA8PSA4NSA7IGkrKyApCiAgICB7CiAgICAgICAgZmliW2ldID0gZmliW2ktMV0gKyBmaWJbaS0yXTsKICAgIH0KICAgIGNvdXQgPDwgZmliWzRdOwogICAgc3RyaW5nIHM7CiAgICB3aGlsZShjaW4gPj4gcykKICAgIHsKICAgICAgICB1bnNpZ25lZCBsb25nIGxvbmcgcmVzID0gMSxjID0gMTsKICAgICAgICBpZiAocyA9PSAiMCIpIGJyZWFrOwogICAgICAgIGZvciAoaW50IGkgPSAwIDsgaSA8IHMuc2l6ZSgpIC0gMSA7IGkrKyApCiAgICAgICAgewogICAgICAgICAgICBpbnQgbiA9IChzW2ldIC0gNDggKSoxMCArIChzW2krMV0gLSA0OCApOwogICAgICAgICAgICBpZiAoIGkrIDIgPCBzLnNpemUoKSAmJiBzW2krMl0gPT0gJzAnKSByZXMgKj0gZmliWysrY10gLCBjID0gMTsKICAgICAgICAgICAgZWxzZSBpZiAoIHNbaSArIDFdID09ICcwJykgaSArKyAsICByZXMgKj0gZmliWysrY10gLCBjID0gMTsKICAgICAgICAgICAgZWxzZSBpZiAobiA8PSAyNikgYysrOwogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHJlcyAqPSBmaWJbKytjXSAsIGMgPSAxOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGludCBjaGVjayA9IHMuZmluZCgiMDAiKTsKICAgICAgICBpZiAoY2hlY2sgPj0gMCkgcmVzID0gMDsKICAgICAgICBjb3V0IDw8IHJlcyAqIGZpYlsrK2NdPDwgIlxuIjsKICAgIH0KfQo=