eolymp
bolt
Try our new interface for solving problems
Problems

Script

Script

Temirulan is an advanced programmer and often uses various scripts to do routine tasks. Sometimes instead of writing new scripts, his scripts are just sequences of scripts he wrote before.

Currently, Temirulan is working with NOOB (Network Optimized Object Base) online machine which accepts two types of requests:

  1. Upload a script file and place it at the end of the machine’s buffer for one dollar.
  2. Copy the subsequent scripts in the machine’s buffer and place them at the end of the buffer with no fee.

For simplicity, let’s represent the sequence of scripts that Temirulan wants to execute with the string s of lowercase English letters. Each symbol represents a script file. Find the minimum amount of money Temirulan has to pay to run his script on the machine.

Input

Input contains one string s (1|s|50) - the sequence of scripts.

Output

Print the minimum amount of money Temirulan has to pay to run his script.

Example

In the sample test, Temirulan first uploads scripts a, b, c, paying 3 dollars. Then puts "abc" copy at the end. Finally, he pays one dollar for d script.

Time limit 1 second
Memory limit 128 MiB
Input example #1
abcabcd
Output example #1
4
Source 2021 KBTU Open, Spring Kazakhstan, Alma-Ata, May 30, Problem I