#include<bits/stdc++.h>
using namespace std;
int n;
void go(string s,int x){
if(x>n) return;
string p="1";
s+=p;
for(int i=0;i<20;i++){
go(s,x+1);
}
}
int main(){
clock_t t=clock();
cin>>n;
string s="1";
for(int i=0;i<20;i++){
go(s,1);
}
cout<<clock()-t;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG47CnZvaWQgZ28oc3RyaW5nIHMsaW50IHgpewoJaWYoeD5uKSByZXR1cm47CglzdHJpbmcgcD0iMSI7CglzKz1wOwoJZm9yKGludCBpPTA7aTwyMDtpKyspewoJCWdvKHMseCsxKTsKCX0JCn0KaW50IG1haW4oKXsKCWNsb2NrX3QgdD1jbG9jaygpOwoJY2luPj5uOwoJc3RyaW5nIHM9IjEiOwoJZm9yKGludCBpPTA7aTwyMDtpKyspewoJCWdvKHMsMSk7Cgl9Cgljb3V0PDxjbG9jaygpLXQ7Cn0=