L. Lazy Printing
time limit per test
0.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Vinícius has an interesting typing machine. The machine accepts instructions consisting of a non-empty string $$$s$$$ and a positive integer $$$n$$$. For each such instruction, the machine prints $$$n$$$ characters: the $$$i$$$-th ($$$0$$$-based) printed character equals $$$s_r$$$, where $$$r$$$ is the remainder after dividing $$$i$$$ by the length of $$$s$$$ and $$$s_r$$$ denotes the $$$r$$$-th ($$$0$$$-based) character of $$$s$$$. For instance, with the sequence of instructions:

  1. $$$s=$$$"ab", $$$n=4$$$
  2. $$$s=$$$"cd", $$$n=3$$$
  3. $$$s=$$$"xx", $$$n=2$$$
the machine will print "ababcdcxx".

Vinícius is lazy, so he only gives strings of length at most $$$D$$$ to the machine in each instruction. Since he is very lazy, he also wants to use as few instructions as possible. Given a string $$$T$$$ and the integer $$$D$$$, help Vinícius find the minimum number of instructions he needs in order to print $$$T$$$ using the machine.

Input

The input consists of a single line that contains a string $$$T$$$ of lowercase letters followed by the integer $$$D$$$ ($$$1 \leq D \leq |T| \leq 2 \times 10^5$$$), as described in the statement.

Output

Output a single line with an integer indicating the minimum number of instructions Vinícius needs.

Examples
Input
ababcdcxx 2
Output
3
Input
aaabbcd 1
Output
4
Input
abcabca 3
Output
1