Score : $700$ points
You are given a string $S$ consisting of a,b and c. Find the number of strings that can be possibly obtained by repeatedly performing the following operation zero or more times, modulo $998244353$:
a, b and c).a, b and c.Input is given from Standard Input in the following format:
$S$
Print the number of strings that can be possibly obtained by repeatedly performing the operation, modulo $998244353$.
abc
3
abc, aaa and ccc can be obtained.
abbac
65
babacabac
6310
ababacbcacbacacbcbbcbbacbaccacbacbacba
148010497