{"problem":{"name":"Shift Table","description":{"content":"Takahashi and Aoki will work part-time for the next $N$ days.   Takahashi's shift schedule is given by the string $S$, where the $i$\\-th character of $S$ is `#` if he works on the $i$\\-th day, and `.`","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc304_f"},"statements":[{"statement_type":"Markdown","content":"Takahashi and Aoki will work part-time for the next $N$ days.  \nTakahashi's shift schedule is given by the string $S$, where the $i$\\-th character of $S$ is `#` if he works on the $i$\\-th day, and `.` if he is absent on the $i$\\-th day.  \nBased on this, Aoki created his shift schedule as follows.\n\n*   First, take a positive divisor $M$ of $N$ that is not equal to $N$.\n*   Next, decide the attendance for the first $M$ days.\n*   Finally, for $i = 1, 2, \\ldots, N - M$ in this order, decide the attendance for the $(M + i)$\\-th day so that it matches the attendance for the $i$\\-th day.\n\nNote that different values of $M$ may lead to the same final shift schedule.\nFind the number of possible shift schedules for Aoki such that at least one of Takahashi and Aoki works on each of the $N$ days, modulo $998244353$.\n\n## Constraints\n\n*   $N$ is an integer between $2$ and $10^5$, inclusive.\n*   $S$ is a string of length $N$ consisting of `#` and `.`.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc304_f","tags":[],"sample_group":[["6\n##.#.#","3\n\nTakahashi works on days $1$, $2$, $4$, and $6$.  \nLet $T$ be the string representing Aoki's shift schedule, where the $i$\\-th character of $T$ is `#` if he works on the $i$\\-th day, and `.` if he is absent on the $i$\\-th day.  \nThere are three possible strings for $T$: `######`, `#.#.#.`, and `.##.##`.\nThe first shift schedule can be realized by choosing $M = 1$ or $2$ or $3$, the second by choosing $M = 2$, and the third by choosing $M = 3$."],["7\n...####","1"],["12\n####.####.##","19"]],"created_at":"2026-03-03 11:01:13"}}