import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main
(String[] args
) { Scanner scanner
= new Scanner
(System.
in); int n = scanner.nextInt();
scanner.close();
int maxK = 1; // 最多划分的伪周期串数量,初始化为1
// 枚举每一种划分的可能长度
for (int length = 1; length <= n; length++) {
// 如果当前长度不能整除整个字符串长度,则跳过
if (n % length != 0) {
continue;
}
boolean valid = true; // 判断当前划分是否有效
// 统计子串的字符频率
int[][] freq = new int[n / length][10]; // 记录每个子串中0-9字符的频率
for (int i = 0; i < n; i++) {
char c = T.charAt(i);
freq[i / length][c - '0']++; // 计算每个子串的字符频率
}
// 检查这些子串是否能通过交换变成相同的字符组成的伪周期串
for (int i = 1; i < n / length; i++) {
if (!Arrays.
equals(freq
[i
], freq
[0])) { valid = false;
break;
}
}
// 如果当前划分有效,更新最大k值
if (valid) {
maxK = n / length;
}
}
// 输出最大的伪周期串个数
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwppbXBvcnQgamF2YS51dGlsLkFycmF5czsKCnB1YmxpYyBjbGFzcyBNYWluewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIFNjYW5uZXIgc2Nhbm5lciA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CiAgICAgICAgaW50IG4gPSBzY2FubmVyLm5leHRJbnQoKTsKICAgICAgICBTdHJpbmcgVCA9IHNjYW5uZXIubmV4dCgpOwogICAgICAgIHNjYW5uZXIuY2xvc2UoKTsKICAgICAgICAKICAgICAgICBpbnQgbWF4SyA9IDE7ICAvLyDmnIDlpJrliJLliIbnmoTkvKrlkajmnJ/kuLLmlbDph4/vvIzliJ3lp4vljJbkuLoxCiAgICAgICAgCiAgICAgICAgLy8g5p6a5Li+5q+P5LiA56eN5YiS5YiG55qE5Y+v6IO96ZW/5bqmCiAgICAgICAgZm9yIChpbnQgbGVuZ3RoID0gMTsgbGVuZ3RoIDw9IG47IGxlbmd0aCsrKSB7CiAgICAgICAgICAgIC8vIOWmguaenOW9k+WJjemVv+W6puS4jeiDveaVtOmZpOaVtOS4quWtl+espuS4sumVv+W6pu+8jOWImei3s+i/hwogICAgICAgICAgICBpZiAobiAlIGxlbmd0aCAhPSAwKSB7CiAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgfQogICAgICAgICAgICAKICAgICAgICAgICAgYm9vbGVhbiB2YWxpZCA9IHRydWU7ICAvLyDliKTmlq3lvZPliY3liJLliIbmmK/lkKbmnInmlYgKICAgICAgICAgICAgCiAgICAgICAgICAgIC8vIOe7n+iuoeWtkOS4sueahOWtl+espumikeeOhwogICAgICAgICAgICBpbnRbXVtdIGZyZXEgPSBuZXcgaW50W24gLyBsZW5ndGhdWzEwXTsgLy8g6K6w5b2V5q+P5Liq5a2Q5Liy5LitMC055a2X56ym55qE6aKR546HCiAgICAgICAgICAgIAogICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgICAgICAgICAgY2hhciBjID0gVC5jaGFyQXQoaSk7CiAgICAgICAgICAgICAgICBmcmVxW2kgLyBsZW5ndGhdW2MgLSAnMCddKys7ICAvLyDorqHnrpfmr4/kuKrlrZDkuLLnmoTlrZfnrKbpopHnjocKICAgICAgICAgICAgfQogICAgICAgICAgICAKICAgICAgICAgICAgLy8g5qOA5p+l6L+Z5Lqb5a2Q5Liy5piv5ZCm6IO96YCa6L+H5Lqk5o2i5Y+Y5oiQ55u45ZCM55qE5a2X56ym57uE5oiQ55qE5Lyq5ZGo5pyf5LiyCiAgICAgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgbiAvIGxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBpZiAoIUFycmF5cy5lcXVhbHMoZnJlcVtpXSwgZnJlcVswXSkpIHsKICAgICAgICAgICAgICAgICAgICB2YWxpZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIAogICAgICAgICAgICAvLyDlpoLmnpzlvZPliY3liJLliIbmnInmlYjvvIzmm7TmlrDmnIDlpKdr5YC8CiAgICAgICAgICAgIGlmICh2YWxpZCkgewogICAgICAgICAgICAgICAgbWF4SyA9IG4gLyBsZW5ndGg7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgCiAgICAgICAgLy8g6L6T5Ye65pyA5aSn55qE5Lyq5ZGo5pyf5Liy5Liq5pWwCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG1heEspOwogICAgfQp9Cg==