#include using namespace std; int main(){ string S; cin>>S; int p; p=S.size(); vector N(p); for(int i=0;i MOD={1000000000,1000000007}; for(int j=0;j<2;j++){ ans=1; for(int i=p/2-1;i>=0;i--){ if(N[i]>N[p-1-i]){ ans=0; break; }else if(N[i]0;i--){ ans=(ans+temp*N[i])%MOD[j]; temp=(temp*10)%MOD[j]; } ans=(ans+temp*(N[0]-1))%MOD[j]; temp=9; for(int i=1;i