#include <stdio.h>
int main(void) {
int i,ii,iii,iiii,iiiii,n,p = 0;
for(i = 1;i <= 6;i++){
for(ii = 1;ii <= 6;ii++){
for(iii = 1;iii <= 6;iii++){
for(iiii = 1;iiii <= 6;iiii++){
for(iiiii = 1; iiiii <= 6;iiiii++){
n = i * 10000 + ii * 1000 + iii * 100 + iiii * 10 + iiiii * 1;
if (n % 7 == 0){
p = p + 1;
}
}
}
}
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgaSxpaSxpaWksaWlpaSxpaWlpaSxuLHAgPSAwOwoJZm9yKGkgPSAxO2kgPD0gNjtpKyspewoJCWZvcihpaSA9IDE7aWkgPD0gNjtpaSsrKXsKCQkJZm9yKGlpaSA9IDE7aWlpIDw9IDY7aWlpKyspewoJCQkJZm9yKGlpaWkgPSAxO2lpaWkgPD0gNjtpaWlpKyspewoJCQkJCWZvcihpaWlpaSA9IDE7IGlpaWlpIDw9IDY7aWlpaWkrKyl7CgkJCQkJCW4gPSBpICogMTAwMDAgKyBpaSAqIDEwMDAgKyBpaWkgKiAxMDAgKyBpaWlpICogMTAgKyBpaWlpaSAqIDE7CgkJCQkJCWlmIChuICUgNyA9PSAwKXsKCQkJCQkJCXAgPSBwICsgMTsKCQkJCQkJfQoJCQkJCX0KCQkJCX0KCQkJfQoJCX0KCX0KCXByaW50ZigiJWRcbiIsIHApOwoJcmV0dXJuIDA7Cn0K