#include <bits/stdc++.h>
char s[1010];
bool vis[1010];
int l;
int abs(int x) {
  if (x < 0) return -x;
  return x;
}
int find(int pos) {
  for (int i = pos + 1; i < l; i++)
    if (vis[i] && s[i] != s[pos]) return i;
  return 0;
}
int main() {
  while (gets(s)) {
    l = strlen(s);
    memset(vis, true, sizeof(vis));
    int cnt = 0, ans = 0;
    for (int i = 0; i < l; i++) {
      if (vis[i]) {
        int k = i;
        while (find(k)) {
          k = find(k);
          vis[k] = false;
        }
        ans++;
      }
    }
    printf("%d\n", ans);
  }
}
