#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, sum = 0;
  char x = getchar();
  for (; (x < '0' || x > '9'); x = getchar())
    if (x == '-') f = -1;
  for (; x >= '0' && x <= '9'; x = getchar()) sum = sum * 10 + x - '0';
  return f * sum;
}
int ans;
int js[105], ni[105], inv[105];
map<string, int> st;
inline int qpow(int x, int ci) {
  int sum = 1;
  for (; ci; ci >>= 1, x = 1ll * x * x % 1000000007)
    if (ci & 1) sum = 1ll * sum * x % 1000000007;
  return sum;
}
inline void inc(int &x, int y) {
  x += y, x -= x >= 1000000007 ? 1000000007 : 0;
}
inline void dfs(string s) {
  if (st.count(s)) return;
  st[s] = 1;
  int t = 0;
  int len = s.size();
  for (int i = 0; i <= len - 2; ++i) {
    if (s[i] != s[i + 1]) continue;
    int opt = s[i] - 'a';
    opt ^= 1;
    string to;
    for (int j = 0; j <= i - 1; ++j) to += s[j];
    to += char(opt + 'a');
    for (int j = i + 2; j <= len - 1; ++j) to += s[j];
    dfs(to);
  }
}
int main() {
  js[0] = 1;
  for (int i = 1; i <= 100; ++i) js[i] = 1ll * js[i - 1] * i % 1000000007;
  ni[100] = qpow(js[100], 1000000007 - 2);
  for (int i = 100; i >= 1; --i) ni[i - 1] = 1ll * ni[i] * i % 1000000007;
  for (int i = 1; i <= 100; ++i) inv[i] = 1ll * ni[i] * js[i - 1] % 1000000007;
  string s;
  cin >> s;
  dfs(s);
  cout << st.size() << endl;
}
