#include <bits/stdc++.h>
using namespace std;
const int maxn = 8800;
char s[maxn], buf[20];
int cnt[maxn], dp[maxn] = {0}, pre[maxn];
void kmp(char *s, int len, int pre[]) {
  pre[0] = pre[1] = 0;
  for (int i = 1; i < len; ++i) {
    int j = pre[i];
    while (j && s[i] != s[j]) j = pre[j];
    pre[i + 1] = s[j] == s[i] ? j + 1 : 0;
  }
}
int main() {
  scanf("%s", s);
  int len = strlen(s);
  for (int i = 1; i <= len; ++i) cnt[i] = sprintf(buf, "%d", i), dp[i] = i + 1;
  for (int i = 0; i < len; ++i) {
    kmp(s + i, len - i, pre);
    for (int j = 1; j + i <= len; ++j) {
      int xlen = j - pre[j];
      if (j % xlen == 0)
        dp[j + i] = min(dp[j + i], dp[i] + cnt[j / xlen] + xlen);
      else
        dp[j + i] = min(dp[j + i], dp[i] + 1 + j);
    }
  }
  printf("%d\n", dp[len]);
  return 0;
}
