#include <bits/stdc++.h>  

#define yy cout<<"YES"<<endl;
#define nn cout<<"NO"<<endl;
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) 
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) 
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) 
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) 
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) 
#define rep(i, a, n) for (int i = a; i < n; i++)
#define mod 1000000007

#define fi first
#define se second
#define int             long long
#define w(x)            int x; cin>>x; while(x--)
#define endl            ("\n")
#define f(i, a, n)      for(int i=a; i<n; i++)
#define pb              push_back
#define mi(a,b,c)       min(a,min(b,c))
#define cc(r)           cout<<r<<" "
#define ce(r)           cout<<r<<endl

#define all(x) (x).begin(), (x).end() 
#define rall(x) (x).rbegin, (x).rend() 

#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)

#define present(c,x) ((c).find(x) != (c).end())

#define cpresent(c,x) (find(all(c),x) != (c).end())

#define sz(a) int((a).size())


using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;


int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(14);
    cout << fixed;
    int t =1 ;
    //cin >> t ;
    while (t--)
    {
        int a, b ,c ;
        cin >> a >>b >> c ;
        cout << 21- a - b - c ;
    }
    return 0;
}    
#include <bits/stdc++.h>
#include <bits/extc++.h>
#define double long double
#define rbtree __gnu_pbds::tree<int,__gnu_pbds::null_type,less<int>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>
#define int ll
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);
#define pb push_back
#define ALL(X) X.begin(),X.end()
#define F(i,n)  FF(i,0,n)
#define F1(i,n)  FF(i,1,n+1)
#define FF(i,n,m) for(int i=(int)n;i<(int)m;++i)
#ifndef LOCAL
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#else
#endif // LOCOL
//#define mp make_pair
using namespace std;
//using namespace __gnu_pbds;
template<typename T> bool remax(T& a, const T& b) {return b>a?a=b,1:0;}
template<typename T> bool remin(T& a, const T& b) {return b<a?a=b,1:0;}
inline ostream& operator << (ostream& os,__int128_t a){if(a==0) {return (os<<'0');}bool flag=0;if(a<0) {a=-a,flag=1;}string s;while(a){s+=a%10+'0';a/=10;}s+=flag?"-":"";reverse(ALL(s));return os<<s;}
inline istream& operator >>(istream& is,__int128_t& a){string s;cin>>s;a=0;for(auto c:s) a=a*__int128_t(10)+__int128_t(c-'0');return is;}
template<typename T,typename P> inline ostream& operator << (ostream& os,pair<T,P> a){os<<a.first<<" "<<a.second; return os;}
template<typename T,typename P> inline istream& operator >> (istream& is,pair<T,P> &a){is>>a.first>>a.second; return is;}
using ll=long long;
using ull=unsigned long long;
using int128= __int128_t;
using uint128= __uint128_t;
using pii =pair<int,int>;
const double pi=acos(-1);
const int N=1E5+5;
const ll M=1000000000;
const ll INF_64=0x3f3f3f3f3f3f3f3f;
const int INF_32=0x3f3f3f3f;
const int16_t INF_16=0x3f3f;
const int klog=20;
const int mod=1E9+7;//998244353
const double eps=1E-8;
void gen(){
}
vector<int> an;
bool DD(int x,int y){
    if(x==0||y==0){
        if(an.size()+x+y>130) return false;
        while(x--) an.pb(1);
        while(y--) an.pb(2);
        return true;
    }
    if(x>=y)
        x-=y,an.pb(3);
    else y-=x,an.pb(4);
    return DD(x,y);
}
int re(){
    int x=0,y=0;
    F(i,an.size()){
        if(an[i]==1) x++;
        else if(an[i]==2) y++;
        else if(an[i]==3) x+=y;
        else if(an[i]==4) y+=x;
    }

    return x;
}
void sol(){
    int n;
    cin>>n;
    std::random_device rd;
    std::default_random_engine gen = std::default_random_engine(rd());
    std::uniform_int_distribution<int> dis(n/4,3*n/4);
    int tt;

    if(n<=130){
        cout<<n<<"\n";
        F(i,n) cout<<1<<"\n";
        return;
    }
    while(tt=dis(gen)){
        an.clear();
        an.pb(3);
        if(!DD(tt,n-tt)) continue;
        //cerr<<tt<<"\n";
        cout<<an.size()<<"\n";
        reverse(ALL(an));
        assert(re()==n);
        F(i,an.size()) cout<<an[i]<<"\n";
        return;
    }

}
int32_t main(){
    #ifdef LOCAL
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    #endif // LOCAL
    IOS;
    int t=1;
    gen();
    //cin>>t;
    FF(i,1,t+1){
        //cout<<"Case #"<<i<<": ";
        sol();
    }
}
