#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;

long long N;
long long fib[1 << 18];

void init() {
	fib[0] = 1; fib[1] = 1;
	for (int i = 2; i <= 90; i++) fib[i] = fib[i - 1] + fib[i - 2];
}

int main() {
	cin >> N;
	init();

	long long idx = -1, rem = -1;
	for (int i = 1; i <= 89; i++) {
		if (fib[i] > N) { idx = i - 1; rem = N - fib[i - 1]; break; }
	}

	string S = "";
	for (int i = 1; i <= idx; i++) {
		if (i % 2 == 1) S = "3" + S;
		if (i % 2 == 0) S = "4" + S;
	}
	if (S[0] == '4') S = "1" + S;
	else S = "2" + S;

	for (int i = 89; i >= 1; i--) {
		if (rem < fib[i]) continue;
		rem -= fib[i];
		int cnt = 0;
		for (int j = (int)S.size() - 1; j >= 0; j--) {
			if (S[j] == '3' || S[j] == '4') cnt++;
			if (cnt == i + 1) {
				string T1 = S.substr(0, j + 1);
				string T2 = S.substr(j + 1, S.size() - (j + 1));
				string U = "";
				if (S[j] == '3') U = T1 + "1" + T2;
				if (S[j] == '4') U = T1 + "2" + T2;
				S = U;
				break;
			}
		}
	}

	cout << S.size() << endl;
	for (int i = 0; i < S.size(); i++) cout << S[i] << endl;
	return 0;
}
#include<bits/stdc++.h>
#define N 5000005
using namespace std;
int read() {
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
int n,a[N],b[N],ans;
bool tag[2005];
int main() {
	n = read();
	for(int i=1; i<=n; ++i)a[i] = read();
	for(int i=1; i<=n; ++i) {
		for(int j=1; j<=sqrt(a[i]); ++j) {
			if(a[i]%j == 0)b[++b[0]] = j,b[++b[0]] = a[i]/j;
		}
	}
	sort(b+1,b+b[0]+1);
	b[0] = unique(b+1,b+b[0]+1)-b-1;
	for(int i=1; i<=b[0]; ++i) {
		int x = b[i],now = 0,id,suc;
		memset(tag,0,sizeof(tag));
		for(int j=1; j<=n; ++j)if(a[j]%x == 0){suc = now = a[j];id = j+1;tag[j] = 1;break;}
		for(int j=id; j<=n; ++j) {
			if(a[j]%x == 0)now = __gcd(now,a[j]),tag[j] = 1;
		}
		if(now == x)suc = 1;
		else suc = 0;
		for(int j=1; j<=n; ++j)if(now > a[j])suc = 0;
		ans += suc;
	}
	cout << ans;
}