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:
 - Choose an integer i such that 1\leq i\leq |S|-1 and the i-th and (i+1)-th characters in S are different. Replace each of the i-th and (i+1)-th characters in S with the character that differs from both of them (among a, b and c).

-----Constraints-----
 - 2 \leq |S| \leq 2 × 10^5
 - S consists of a, b and c.

-----Input-----
Input is given from Standard Input in the following format:
S

-----Output-----
Print the number of strings that can be possibly obtained by repeatedly performing the operation, modulo 998244353.

-----Sample Input-----
abc

-----Sample Output-----
3

abc, aaa and ccc can be obtained.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "def main():\n    a = input().strip()\n    l = len(a)\n    if l < 6:\n        s = set()\n        s.add(a)\n        q = [a]\n        oa = ord('a')\n        while q:\n            a = q.pop()\n            for i in range(l - 1):\n                if a[i] != a[i+1]:\n                    t = chr(oa + 3 - (ord(a[i]) - oa) - (ord(a[i+1]) - oa))\n                    na = a[:i] + t * 2 + a[i+2:]\n                    if na not in s:\n                        s.add(na)\n                        q.append(na)\n        print(len(s))\n        return\n    t = a[0] * l\n    if t == a:\n        print(1)\n        return\n    x = 0\n    for c in a:\n        if c == 'b':\n            x += 1\n        elif c == 'c':\n            x += 2\n    ans = 0\n    if all(a[i] != a[i+1] for i in range(l - 1)):\n        ans += 1\n    mod = 998244353\n    dp = (1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)\n    for i in range(l - 1):\n        s = (dp[-1] + dp[-2] + dp[-3]) % mod\n        dp = ((dp[3]+dp[6])%mod,(dp[4]+dp[7])%mod,(dp[5]+dp[8])%mod,(dp[2]+dp[8])%mod,(dp[0]+dp[6])%mod,(dp[1]+dp[7])%mod,(dp[1]+dp[4])%mod,(dp[2]+dp[5])%mod,(dp[0]+dp[3])%mod,(dp[0]+dp[5]+dp[7]+s)%mod,(dp[1]+dp[3]+dp[8]+s)%mod,(dp[2]+dp[4]+dp[6]+s)%mod)\n    print((ans + dp[9+x%3]) % mod)\nmain()\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14915