#include <bits/stdc++.h>
using namespace std;
const int maxn = 10000;
char s[maxn];
int f[maxn], n, g[maxn];
void get_fail(char *s) {
  n = strlen(s);
  f[0] = f[1] = 0;
  for (int i = 1; i < n; i++) {
    int j = f[i];
    while (s[j] != s[i] && j) j = f[j];
    f[i + 1] = s[j] == s[i] ? j + 1 : 0;
  }
  return;
}
inline int cal(int x) {
  int res = 0;
  while (x) {
    res++;
    x /= 10;
  }
  return res;
}
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  g[0] = 0;
  for (int i = 1; i <= n; i++) g[i] = 1 << 30;
  for (int i = 0; i < n; i++) {
    get_fail(s + i + 1);
    for (int j = i + 1; j <= n; j++) {
      int k = j - i;
      int tmp;
      if (k % (k - f[k]) == 0) {
        int len = k - f[k];
        tmp = len + cal(k / len);
      } else
        tmp = k + 1;
      g[j] = min(g[j], g[i] + tmp);
    }
  }
  cout << g[n] << endl;
  return 0;
}
