#agc046d. [agc046_d]Secret Passage

[agc046_d]Secret Passage

Problem Statement

Given is a string SS consisting of 0 and 1. Find the number of strings, modulo 998244353998244353, that can result from applying the following operation on SS zero or more times:

  • Remove the two characters at the beginning of SS, erase one of them, and reinsert the other somewhere in SS. This operation can be applied only when SS has two or more characters.

Constraints

  • 1leqSleq3001 \\leq |S| \\leq 300
  • SS consists of 0 and 1.

Input

Input is given from Standard Input in the following format:

SS

Output

Print the number of strings, modulo 998244353998244353, that can result from applying the operation on SS zero or more times.


Sample Input 1

0001

Sample Output 1

8

Eight strings, 0001, 001, 010, 00, 01, 10, 0, and 1, can result.


Sample Input 2

110001

Sample Output 2

24

Sample Input 3

11101111011111000000000110000001111100011111000000001111111110000000111111111

Sample Output 3

697354558