#include "iostream"
#include "string"
string countAndSay(int n)
{
if (1 == n)
return "1";
else
{
string last_str = countAndSay(n - 1);
char num = '1';
char temp = last_str.at(0);
string output = "";
for (int i = 1; i < last_str.size(); i++)
{
if (last_str.at(i) == temp)
num++;
else
{
output.push_back(num);
output.push_back(temp);
temp = last_str.at(i);
num = '1';
}
}
output.push_back(num);
output.push_back(temp);
return output;
}
}
int main() {
int input;
cin >> input;
string str = countAndSay(input);
cout << str << endl;
system("pause");
return 0;
}