#define MD 998244353 ll@n;Mint a,b,c,z;string@s;for(ll d:s){++a;rep(d)(a,b,c)=(b,c,a);if(d>57)(a,b,c)+=(a+b+c)*3;z+=a;}wt(z);