#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 1e4 + 10;
char a[N];
int nxt[N];
void kmp(char* a, int n) {
  int i, j;
  for (nxt[0] = j = -1, i = 1; i < n; nxt[i++] = j) {
    while (~j && a[j + 1] != a[i]) j = nxt[j];
    if (a[j + 1] == a[i]) j++;
  }
}
int f[N];
void down(int& x, int y) {
  if (y < x) x = y;
}
int get(int x) {
  int res = 0;
  while (x) {
    res++, x /= 10;
  }
  return res;
}
int main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> (a + 1);
  int len = strlen(a + 1);
  for (int i = 1; i <= len; i++) f[i] = i + 1;
  for (int i = 1; i <= len; i++) {
    int l = len - i + 1;
    kmp(a + i, l);
    for (int j = 0; j < l; j++) {
      int now = j - nxt[j];
      if ((j + 1) % now == 0)
        down(f[i + j], f[i - 1] + get((j + 1) / now) + now);
      else
        down(f[i + j], f[i - 1] + j + 1 + 1);
    }
  }
  cout << f[len] << '\n';
  return 0;
}
