<>;$_=<>;$%=/1/;s/10*(?=1)/($%*=length$&.1)%=998244353/ge;print$%