#include <bits/stdc++.h>
using namespace std;
long long len(long long n) {
  long long num = 10;
  for (long long i = 1; i <= 10; i++) {
    if (n / num == 0) return i;
    num *= 10;
  }
  return 0;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  const long long inf = 1e9;
  vector<long long> dp(n, inf);
  dp[0] = 2;
  for (long long i = 1; i < n; i++) {
    dp[i] = dp[i - 1] + 2;
    string curr;
    vector<long long> prefix;
    curr.push_back(s[i]);
    prefix.push_back(0);
    long long border;
    for (long long j = i - 1; j >= 0; j--) {
      curr.push_back(s[j]);
      border = prefix.back();
      while (border > 0 && curr[border] != s[j]) border = prefix[border - 1];
      if (border == 0)
        prefix.push_back((s[j] == curr[0]));
      else
        prefix.push_back(border + 1);
      if (prefix.back() != 0 &&
          (i - j + 1) % (i - j + 1 - prefix.back()) == 0) {
        dp[i] = min(dp[i], (j - 1 >= 0 ? dp[j - 1] : 0) +
                               (i - j + 1 - prefix.back()) +
                               len((i - j + 1) / (i - j + 1 - prefix.back())));
      } else
        dp[i] = min(dp[i], (j - 1 >= 0 ? dp[j - 1] : 0) + 1 + (i - j + 1));
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}
