#include <bits/stdc++.h>
using namespace std;
int len, n[8002], f[8002], dp[8002][8002];
string s;
int main() {
  cin >> s;
  len = s.length();
  memset(f, 0x1f, sizeof(f));
  f[0] = 0;
  for (int i = len - 1; i >= 0; --i) {
    for (int j = len - 1; j >= 0; --j) {
      dp[i][j] = s[i] == s[j] ? dp[i + 1][j + 1] + 1 : 0;
    }
  }
  for (int i = 1; i <= len; ++i) {
    int t = i, s = 0;
    while (t) ++s, t /= 10;
    n[i] = s;
  }
  for (int i = 0; i < len; ++i) {
    for (int j = 1; i + j <= len; ++j) {
      int num = 1;
      for (int k = i + j; k <= len; k += j) {
        if (dp[i][k - j] < j) break;
        f[k] = min(f[k], f[i] + n[num] + j);
        ++num;
      }
    }
  }
  cout << f[len] << endl;
  return 0;
}
