#include <stdio.h>
main() {
int s, el = 0;
for (int i = 6; i <= 30; i++) {
s=0;
for (int j = 1; j <= i / 2; j++)
if (i % j == 0)
s = s + j;
if (s == i)
el++;
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cm1haW4oKSB7CglpbnQgcywgZWwgPSAwOwoJZm9yIChpbnQgaSA9IDY7IGkgPD0gMzA7IGkrKykgewoJCXM9MDsKCQlmb3IgKGludCBqID0gMTsgaiA8PSBpIC8gMjsgaisrKQoJICAgIAlpZiAoaSAlIGogPT0gMCkKCSAgICAgICAgCXMgPSBzICsgajsKICAgIAlpZiAocyA9PSBpKQoJICAgIAllbCsrOwogICAgfQogICAgcHJpbnRmKCIlZCIsIGVsKTsKfQo=