# include <stdio.h>
# include <stdlib.h>
# include <string.h>

# define MAXN 300300

# define MOD 998244353

int n;
int res;
char s1[MAXN];
char s2[MAXN];
char pxor[MAXN];
int pos[MAXN][2];
int dp[MAXN][2];

int main() {
  int d;
  int k1, k2;
  int i, j, k;
  int xr, xr1, xr2;
  scanf("%s", s1+1);
  pxor[0] = 0;
  for (i = 1; s1[i] != '\0'; i++) {
  	s2[i] = s1[i] - '0';
  	pxor[i] = pxor[i-1] ^ s2[i];
  }
  n = i - 1;
  xr2 = pxor[n];
  pos[n][0] = pos[n][1] = n + 1;
  pos[n][pxor[n]] = n;
  for (i = n - 1; i >= 0; i--) {
  	pos[i][0] = pos[i+1][0];
  	pos[i][1] = pos[i+1][1];
  	pos[i][pxor[i]] = i;
  }
  dp[0][0] = 1;
  k1 = 0; k2 = 1;
  for (i = 1; i <= n; i++) {
    for (xr = 0; xr < 2; xr++) {
      j = pos[i][pxor[i-1] ^ xr];
//  	      printf("A: d, i, j = %d, %d, %d\n", d, i, j);
//  	      printf("B: d, i, j = %d, %d, %d\n", d, i, j);
  	  if (j <= n) {
  	    for (xr1 = 0; xr1 < 2; xr1++) {
  	      dp[j][xr1 ^ xr] += dp[i-1][xr1];
          if (dp[j][xr1 ^ xr] >= MOD)
            dp[j][xr1 ^ xr] -= MOD;
        }
	  }	
    }
    res += dp[i][xr2];
    if (res >= MOD)
      res -= MOD;
  }
  printf("%d\n", res);
  return 0;
}
