#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];
}
string s;
while(cin >> s)
{
unsigned long long res = 1,c = 1;
if (s == "0") break;
for (int i = 1 ; i < s.size() ; i++ )
{
int n = (s[i] - 48 ) + (s[i-1] - 48 )*10;
if (n <= 26 ) c++;
else
{
res *= fib[++c] , c = 1;
}
}
cout << res * fib[++c]<< "\n";
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQgOwp1bnNpZ25lZCBsb25nIGxvbmcgZmliWzg2XTsKaW50IG1haW4oKQp7CiAgICBmaWJbMF0gPSAwICwgZmliWzFdID0gMTsKICAgIGZvciAoaW50IGkgPSAyIDsgaSA8PSA4NSA7IGkrKyApCiAgICB7CiAgICAgICAgZmliW2ldID0gZmliW2ktMV0gKyBmaWJbaS0yXTsKICAgIH0KICAgIHN0cmluZyBzOwogICAgd2hpbGUoY2luID4+IHMpCiAgICB7CiAgICAgICAgdW5zaWduZWQgbG9uZyBsb25nIHJlcyA9IDEsYyA9IDE7CiAgICAgICAgaWYgKHMgPT0gIjAiKSBicmVhazsKICAgICAgICBmb3IgKGludCBpID0gMSA7IGkgPCBzLnNpemUoKSA7IGkrKyApCiAgICAgICAgewogICAgICAgICAgICBpbnQgbiA9IChzW2ldIC0gNDggKSArIChzW2ktMV0gLSA0OCApKjEwOwogICAgICAgICAgICBpZiAobiA8PSAyNiApIGMrKzsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICByZXMgKj0gZmliWysrY10gLCBjID0gMTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBjb3V0IDw8IHJlcyAqIGZpYlsrK2NdPDwgIlxuIjsKICAgIH0KfQo=