#include <bits/stdc++.h>
using namespace std;
void print(vector<int>& arr) {
  for (int i = 0; i < arr.size(); ++i) {
    cout << arr[i] << ",";
  }
  cout << endl;
}
void prefix_function(vector<int>& arr, const string& s, int idx) {
  arr[idx] = 0;
  int len = 0;
  for (int i = idx - 1; i >= 0; --i) {
    while (1) {
      if (s[i] == s[idx - len]) {
        len++;
        arr[i] = len;
        break;
      } else {
        if (len == 0) {
          arr[i] = len;
          break;
        } else {
          len = arr[idx - len + 1];
        }
      }
    }
  }
}
int digit_count(int n) {
  if (n == 0) return 1;
  int count = 0;
  while (n > 0) {
    count++;
    n /= 10;
  }
  return count;
}
int comp_len(int len, int match) {
  if (len % (len - match) == 0) {
    return (len - match) + digit_count(len / (len - match));
  } else {
    return len + 1;
  }
}
int main() {
  string s;
  cin >> s;
  int n = s.length();
  int dp[n];
  dp[0] = 2;
  vector<int> arr(n);
  for (int i = 1; i < n; ++i) {
    prefix_function(arr, s, i);
    int mp = arr[0];
    dp[i] = comp_len(i + 1, mp);
    for (int j = 0; j < i; ++j) {
      dp[i] = min(dp[i], dp[j] + comp_len(i - j, arr[j + 1]));
    }
  }
  cout << dp[n - 1] << endl;
}
