#include<bits/stdc++.h>
using namespace std;
typedef long long   ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll>  vl;
typedef vector<pair<int,int>> vpi;
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define pb    push_back
#define mp    make_pair
#define rev(i,a,b) for(int i=a;i<b;i++)
#define sz(a)   (int)a.size()
#define all(a)  a.begin(),a.end()
const int  MOD = 1000000000+7;
ll mul(ll x,ll y)
{return (x*y)%MOD;}
ll bin_pow(ll x,ll p)
{if(p==0)return 1;if(p&1)return mul(x,bin_pow(x,p-1));return bin_pow(mul(x,x),p/2);}
ll  gcd(ll a,ll b)
{if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b)
{return a / gcd(a, b) * b;}
bool prime(ll n)
{if(n<=1)return 0;for(ll i=2;i*i<=n;i++)if(n%i==0)return 0; return 1;}
bool adj[5005][5005];
int deg[5005];
int main()
{
    ll n;
    cin>>n;
    vl f;
    n=n*2;
    f.pb(1);
    f.pb(n);
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            f.pb(i);
            if(i*i!=n)
                f.pb(n/i);
        }
    }
   // for(auto i:f)cout<<i<<" ";
    ll a=0;
    for(int i=0;i<sz(f);i++)
    {
        ll x=(n/f[i])+1-f[i];
        if(x%2==0)
            a++;
    }
    cout<<a<<endl;
}



#include <bits/stdc++.h>
#define clog(x) std::clog << (#x) << " is " << (x) << '\n';
using LL = long long;



int main() {
	//freopen("in", "r", stdin);
	std::cin.tie(nullptr)->sync_with_stdio(false);
	LL n;
	std::cin >> n;
	std::vector<LL> F{1, 1};
	while (F.back() <= n) F.emplace_back(F[F.size() - 2] + F[F.size() - 1]);
	F.pop_back();
	int s = F.size(), now = s - 1;
	std::vector<int> a(s), ans;
	while (now >= 0 && n) {
		if (F[now] <= n) { // 不会超过两次的
			n -= F[now];
			++a[s - 1 - now];
		}
		--now;
	}
	for (int i = 0; i < s; ++i) {
		if ((i & 1) == (s & 1)) {
			if (a[i]) ans.emplace_back(2);
			ans.emplace_back(4);
		} else {
			if (a[i]) ans.emplace_back(1);
			ans.emplace_back(3);
		}
	}
	std::cout << ans.size() << '\n';
	for (auto x : ans) std::cout << x << '\n';
	return 0;
}