fun main(arg: Array<String>) {
    var S = readLine()!!
    var L = S.length
    var M = mutableSetOf<String>()
    var n = 0
    var m = -1
    while (n < L) {
        if (n == m) break
        m = n
        for (l in 1 .. L-n) {
            val s = S.substring(n, n+l)
            if (!M.contains(s)) {
                M.add(s)
                n += l
                break
            }
        }
    }
    println(M.size)
}