{"problem":{"name":"Reordering","description":{"content":"Given is a string $S$. How many different strings can be obtained as a permutation of a non-empty, **not necessarily contiguous** subsequence of $S$? Since the count can be enormous, print it modulo $","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc234_f"},"statements":[{"statement_type":"Markdown","content":"Given is a string $S$. How many different strings can be obtained as a permutation of a non-empty, **not necessarily contiguous** subsequence of $S$?\nSince the count can be enormous, print it modulo $998244353$.\n\n## Constraints\n\n*   $S$ is a string of length $1$ and $5000$ (inclusive) consisting of lowercase English letters.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc234_f","tags":[],"sample_group":[["aab","8\n\nThere are $8$ different strings that can be obtained as a permutation of a subsequence of $S$: `a`, `b`, `aa`, `ab`, `ba`, `aab`, `aba`, `baa`."],["aaa","3"],["abcdefghijklmnopqrstuvwxyz","149621752\n\nBe sure to print the count modulo $998244353$."]],"created_at":"2026-03-03 11:01:14"}}