#include<bits/stdc++.h>
using namespace std;
int a, sum, b = 0;
bool chak(int n)
{
sum = 0;
for(int i = 1; i < n; i++)
{
if(n % i == 0)
{
sum += i;
}
}
if(sum == n)
{
return true;
}
else
{
return false;
}
}
int main()
{
cin >> a;
for(int j = 2; j <= a; j++)
{
if(chak(j))
{
cout << j << endl;
b++;
}
}
cout << "*" << b;
return 0;
}