#include <bits/stdc++.h>
using namespace std;
int f[10000];
char p[10000];
int dp[10000];
int len(int val) {
  int cnt = 0;
  while (val) {
    cnt++;
    val /= 10;
  }
  return cnt;
}
void get_fail(char* p) {
  int m = strlen(p);
  f[0] = f[1] = 0;
  for (int i = 1; i < m; i++) {
    int j = f[i];
    while (j && p[i] != p[j]) j = f[j];
    f[i + 1] = p[i] == p[j] ? j + 1 : 0;
  }
}
int main() {
  scanf("%s", p);
  memset(dp, 0x3f3f3f3f, sizeof(dp));
  int n = strlen(p);
  dp[0] = 0;
  for (int i = 0; i <= n; i++) {
    dp[i] = min(dp[i], i + 1);
    if (i == n) break;
    get_fail(p + i);
    for (int j = i + 1; j <= n; j++) {
      dp[j] = min(dp[j], dp[i] + j - i + 1);
      int id = j - i;
      if (f[id] > 0 && id % (id - f[id]) == 0) {
        int k = id / (id - f[id]);
        dp[j] = min(dp[j], dp[i] + id - f[id] + len(k));
      }
    }
  }
  printf("%d\n", dp[n]);
  return 0;
}
