#include <bits/stdc++.h>
using namespace std;
const short N = 8001;
short u[N], lg[N], z[N][N], f[N][N], d[N], n;
string s;
inline void dec(short &a, short b) {
  if (a > b) a = b;
}
void z_func(short q) {
  memset(u, 0, sizeof u);
  string t;
  for (short i = q; i <= n; ++i) t += s[i];
  u[0] = n - q + 1;
  short l = 0, r = 0;
  for (short i = 1; i < (short)t.size(); ++i) {
    if (i > r) {
      l = r = i;
      while (r < (short)t.size() && t[r] == t[r - l]) ++r;
      u[i] = r - l;
      --r;
    } else {
      short y = i - l;
      if (u[y] < r - i + 1)
        u[i] = u[y];
      else {
        l = i;
        while (r < (short)t.size() && t[r] == t[r - l]) ++r;
        u[i] = r - l;
        --r;
      }
    }
  }
  for (short i = 0; i < (short)t.size(); ++i) z[q][i + q] = u[i];
}
void solve() {
  cin >> s;
  n = s.length();
  s = ' ' + s;
  for (short i = 1; i < N; ++i) lg[i] = lg[i / 10] + 1;
  for (short i = 1; i <= n; ++i) z_func(i);
  for (short i = 1; i <= n; ++i)
    for (short j = i; j <= n; ++j) f[i][j] = j - i + 1;
  for (short i = 1; i <= n; ++i)
    for (short j = i; j <= n; ++j)
      if (j + f[i][j - 1] - 1 <= n && z[i][j] >= f[i][j - 1])
        dec(f[i][j + f[i][j - 1] - 1], f[i][j - 1]);
  for (short i = 1; i <= n; ++i) {
    d[i] = f[1][i] + lg[i / f[1][i]];
    for (short j = 1; j <= i; ++j)
      dec(d[i], d[j - 1] + f[j][i] + lg[(i - j + 1) / f[j][i]]);
  }
  cout << d[n];
}
int main() {
  solve();
  return 0;
}
