ll d,s,c;{for(;d-10;d=getchar())d<63?s+=d&15:++c;rd(d);wt(d?s=(Mint(10)**c-1)/9+(s&&s%9==d%9):!s);}