#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int n;
string s;
vector<int> prefixFunction(string s) {
  vector<int> f(s.size());
  int j = 0;
  for (int i = 1; i < s.size(); i++) {
    for (j = f[i - 1]; j && s[i] != s[j]; j = f[j - 1])
      ;
    f[i] = s[i] == s[j] ? j + 1 : 0;
  }
  return f;
}
int cdigit(int x) {
  int rt = 0;
  for (; x; x /= 10) rt++;
  return rt;
}
vector<int> pfun[8005];
int dp[8005];
int solve() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) pfun[i] = prefixFunction(s.substr(i));
  for (int i = 0; i < n; i++) {
    int sz = i + 1;
    int wow = sz - pfun[0][sz - 1];
    int T = sz % wow ? sz : wow;
    int k = sz / T;
    dp[i] = cdigit(k) + T;
    for (int j = 0; j < i; j++) {
      int sz = i - (j + 1) + 1;
      int wow = sz - pfun[j + 1][sz - 1];
      int T = sz % wow ? sz : wow;
      int k = sz / T;
      dp[i] = min(dp[i], dp[j] + cdigit(k) + T);
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
