/**
**      author:XiaKIsGod
**      time:2019.1
**/
#include <bits/stdc++.h>
#define LL long long
#define pb push_back
using namespace std;
const int N = 1000000;
int T;
LL ans=0;
LL sum1=0,sum2=0;
string str;
void dfs(int pos,LL now,LL x,bool tag){
    if(pos==str.size()){
        if(sum1==now+x&&tag){
            //cout<<sum1<<' '<<now+x<<endl;
            ans++;
        }
        return;
    }
    if(!tag){
        sum1=now+x;
        dfs(pos+1,0,str[pos]-'0',true);
    }
    dfs(pos+1,now,x*10+str[pos]-'0',tag);
    dfs(pos+1,now+x,str[pos]-'0',tag);
}
int main()
{
    ios::sync_with_stdio(false);
    while(cin>>str){
        if(str=="END")
            break;
        ans=sum1=sum2=0;
        dfs(0,0,0,0);
        cout<<ans/2<<endl;
	}
	return 0;
}
