#include <bits/stdc++.h>
using namespace std;
const int nmax = 8000 + 42, base = 37, mod = 1e9 + 7;
int n;
string s;
int hsh[nmax][nmax];
int dp[nmax];
vector<int> divs[nmax];
int digs[nmax];
int main() {
  cin >> s;
  n = s.size();
  for (int i = 1; i <= n; i++) digs[i] = 1 + digs[i / 10];
  s = " " + s;
  for (int i = 1; i <= n; i++) {
    int h = 0;
    for (int j = i; j <= n; j++) {
      h = (1LL * base * h + s[j] - 'a' + 1) % mod;
      hsh[i][j] = h;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j = j + i) divs[j].push_back(i);
  for (int i = 1; i <= n; i++) {
    dp[i] = i + 1;
    for (int d = 1; d <= i && d <= dp[i]; d++) {
      for (int j = i; j - d >= 0; j = j - d) {
        if (hsh[j - d + 1][j] != hsh[i - d + 1][i]) break;
        dp[i] = min(dp[i], dp[j - d] + d + digs[(i - j) / d + 1]);
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
