#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <climits>
#include <cstring>
#include <cctype>
#include <ctime>
#include <sstream>
#include <cassert>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;

// <editor-fold defaultstate="collapsed" desc="Defines">

typedef long long ll;
typedef unsigned long long ull;
typedef pair<double, double> dd;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef pair<string, int> si;
typedef pair<double, ll> pdl;
typedef map<int, int> mi;
typedef map<string, int> msi;
typedef map<string, string> mss;
typedef map<char, int> mci;
typedef set<int> sei;
typedef vector<si> vsi;
typedef vector<dd> vdd;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<string> vs;
const double PI = 3.14159265358979;
const double PI2 = 6.28318530717958;
const double PId2 = 1.570796326794895;
#define MP make_pair
#define X first
#define Y second
#define eps 1E-9
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()

template<typename T> T sqr(T x)
{
    return x*x;
}

template<typename T> T gcd(T a, T b)
{
    return (b ? gcd(b, a % b) : a);
}

ll pw(ll a, ll p, ll mod)
{
    ll res = 1;
    while (p) {
        if (p & 1) {
            --p;
            res = (res * a) % mod;
        } else {
            p >>= 1;
            a = (a * a) % mod;
        }
    }
    return res;
}

inline vi ReadVI(int count)
{
    vi array(count);
    for (int i = 0; i < count; i++)
        scanf("%d", &array[i]);
    return array;
}

inline vll ReadVlong(int count)
{
    vll arrayname(count);
    for (int i = 0; i < count; i++) cin >> arrayname[i];
    return arrayname;
}

const int MOD = 65536;
const int MOD2 = 1073741824;
const int MAXVALUE = 200010;

// </editor-fold >

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#else
    //freopen("longpath.in", "r", stdin);
    //freopen("longpath.out", "w", stdout);
#endif
    int n, k;
    string s;
    cin >> n >> k >> s;
    int len = s.length();
    vi a(len, 0);
    a[0] = 1;
    int l = 0, r = 0;

    while (r < len - 1) {
        int rnew = -1;
        if (r >= l) {
            for (int i = r + k; i >= r + 1; i--)
                if (i < len && s[i] == '.') {
                    a[i] = 1;
                    if (rnew == -1) rnew = i;
                }
        }
        l = r + 1;
        if (rnew == -1)
            return cout << "NO", 0;
        else r = rnew;
    }
    cout << (a[len - 1] ? "YES" : "NO");
    return 0;
}


#include <vector>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <string>
#include <cassert>
#include <stdio.h>

using namespace std;

char ch[1100000];

int main() {
    int n, k;
    while(scanf("%d %d", &n, &k)!=EOF) {
        scanf(" %s", ch);
        int cnt = 0;
        bool fail = false;
        for(int i=0;ch[i];i++) {
            if(ch[i]=='.') cnt = 0;
            else {
                if(i && ch[i-1]=='#') cnt++;
                else cnt = 1;
            }
            if(cnt >= k) fail = true;
        }
        if(fail) puts("NO");
        else puts("YES");
    }
}


#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std;

int main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	int n,k, last = 0;
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; ++i){
		if (s[i] == '#') last++;
		else {
			if (last>=k){
				cout << "NO";
				return 0;
			}
			last = 0;
		}
	}
	cout << "YES";
	return 0;
}


#include<cstdio>
#include<cstring>
#include<queue>
#include<vector>
#include<iostream>
#include<string>
#include<sstream>
#include<cctype>
#include<set>
#include<stack>
#include<functional>
#include<memory>
#include<deque>
#include<list>
#include<cmath>
#include<fstream>
#include<cstdlib>
#include<climits>
#include<iomanip>
#include<cstring>
#include<memory>
#include<bitset>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef vector<int>VI;
typedef vector<VI>VVI;
typedef vector<VVI>VVVI;
const int maxn = 1111111;
const int mod = 1000000007;
template<class T> T gcd(T a,T b){ return b?gcd(b,a%b):a;}
template<class T> T lcm(T a,T b){ return a/gcd(a,b)*b;}
int a[maxn];
char s[maxn];
int main()
{
    ios::sync_with_stdio(false);
    int n,i,j,cnt,k;
    cin>>n>>k;
    cin>>s;
    for(i=0;i<n;++i)
    {
        if(s[i]=='#')
        {
            cnt=0;
            for(j=i;j<n&&s[j]=='#';++j)
            {
                ++cnt;
                if(cnt>=k)
                {
                    cout<<"NO"<<endl;
                    return 0;
                }
            }
            i=j;
        }
    }
    cout<<"YES"<<endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
    int n, k;
    string a;
    cin>>n>>k>>a;
    int ok[2*(n+k)];
    memset(ok, 0, sizeof ok);
    int s=1;
    ok[k+1]=-1;
    for(int i=1;i<n;i++){
        s+=ok[i];
        if (s>0 && a[i]=='.') s++, ok[i+k+1]--;
    }
    if (s>0) cout<<"YES";
    else cout<<"NO";
}


#include <iostream>
using namespace std;

int main()
{
	int n, k;
	cin >> n >> k; cin.ignore(5, '\n');
	char c;
	cin >> c;
	int sharp_count=0;
	bool yes=true;
	for(int i=2; i<=n-1; i++)
	{
		cin >> c;
		if(c=='#')
		{
			sharp_count++;
			if(sharp_count>=k)
			{
				yes=false;
				break;
			}
		}
		else
		{
			sharp_count=0;
		}
	}
	if(yes) cout << "YES";
	else cout << "NO";
	return 0;
}


//abhi
//codeforces
//prob-b

// headrfiles

#include<stdio.h>
#include<stdlib.h>
#include<cstring>
#include<iostream>
#include<ctype.h>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<cmath>
#include<bitset>
#include<iomanip>
#include<complex>
#include<utility>
using namespace std;
int main(){
    string x;
    int n,k;
    cin>>n>>k;
    cin>>x;
    if(x[n-1]=='#'){
        cout<<"NO";
        return 0;
    }
    int c=0;
    for(int i=0;i<n;i++){
        if(x[i]=='#')
            c++;
        else{
            if(c>=k){
                cout<<"NO";
                return 0;
            }
            c=0;
        }
    }
    cout<<"YES";
    return 0;
}


#include <iostream>

int main() {
  int n, k;
  std::cin >> n >> k;

  std::string s;
  std::cin >> s;

  for (int i = 0; i < n; ++i) if (s[i] == '#') {
    int cnt = 1, j;
    for (j = i + 1; j < n && s[j] == '#'; ++j) ++cnt;
    if (cnt >= k) {
      std::cout << "NO";
      return 0;
    }

    i = j;
  }

  std::cout << "YES";
}


#include <iostream>

int main() {
  int n, k;
  std::cin >> n >> k;

  std::string s;
  std::cin >> s;

  for (int i = 0; i < n; ) if (s[i] == '#') {
    int cnt = 1, j;
    for (j = i + 1; j < n && s[j] == '#'; ++j) ++cnt;
    if (cnt >= k) {
      std::cout << "NO";
      return 0;
    }

    i = j;
  }

  std::cout << "YES";
}


#include <iostream>

int main() {
  int n, k;
  std::cin >> n >> k;

  std::string s;
  std::cin >> s;

  for (int i = 0; i < n; ++i) if (s[i] == '#') {
    int cnt = 1;
    for (int j = i + 1; j < n && s[j] == '#'; ++j) ++cnt;

    if (cnt >= k) {
      std::cout << "NO";
      return 0;
    }
  }

  std::cout << "YES";
}


#include <cstdio>
using namespace std;

char s[300005];

int main(){
    int n,m,cnt;
    scanf("%d%d%s",&n,&m,s);
    for(int i=0;i<n;i++){
        if(s[i]=='.') cnt=0;
        if(s[i]=='#') cnt++;
        if(cnt>=m) return puts("NO"),0;
    }
    puts("YES");
}


n = input()
volumes = map(int, raw_input().split())
tots = map(int, raw_input().split())
ans = 0
for i in xrange(n):
    a = volumes[i]
    b = tots[i]
    if(2*a < b):
        ans += -1
    else:
        ans += (b/2) * (b-b/2)
print ans


n = input()
volumes = map(int, raw_input().split())
tots = map(int, raw_input().split())
ans = 0
for i in xrange(n):
    a = volumes[i]
    b = tots[i]
    if(2*a < b or b/2 == 0):
        ans += -1
    else:
        ans += (b/2) * (b-b/2)
print ans


from __future__ import division
import sys
from collections import namedtuple #x=namedtuple('point','x y')
from math import *
from collections import deque, OrderedDict #append #popleft
from fractions import gcd
from copy import copy ,deepcopy
from collections import Counter #Counter(list)
import re #re.split("[^a-zA-Z]",text)
# from functools import lru_cache #@lru_cache(maxsize = None)
"""
#reduce(func,list)
#map(func,list)
#filter(func,list)
#xor=lambda x,y :x^y
#sign = lambda x: math.copysign(1, x)
#list.reverse()
#list.sort() list=sorted(list)
list.sort(key=operator.itemgetter(1,2))
#reverse word word[::-1]
#word.islower()
#word.lower() word.upper()
x = x1 if exp1 else x2
any([false,true])
all([true,false])
"a".isalpha()
"1".isdigit()
int(str,base)
"""

fin=sys.stdin ;fout=sys.stdout
# fin=open('../in','r') ; fout=open('../out','w')
def readline():
    return fin.readline().strip()
def readstrings():
    return fin.readline().strip().split(' ')
def writeline(value):
    fout.write(str(value))
    fout.write("\n")
def read_integers():
    return [int(x) for x in fin.readline().strip().split(' ')]
def read_integer():
    return int(fin.readline().strip())
def end():
    sys.exit()

n=read_integer()
a=read_integers()
b=read_integers()
j=0
for i in range(len(a)):
    if a[i]+a[i]==b[i]:
        j+=a[i]*a[i]
    elif b[i]==1:
        j-=1
    elif a[i]*2>b[i]:
        if b[i]%2==0:
            j+=(b[i]//2)**2
        else:
            j+=(b[i]//2)*(b[i]//2+1)
    else:
        j-=1
print j


from __future__ import division
import sys
from collections import namedtuple #x=namedtuple('point','x y')
from math import *
from collections import deque, OrderedDict #append #popleft
from fractions import gcd
from copy import copy ,deepcopy
from collections import Counter #Counter(list)
import re #re.split("[^a-zA-Z]",text)
# from functools import lru_cache #@lru_cache(maxsize = None)
"""
#reduce(func,list)
#map(func,list)
#filter(func,list)
#xor=lambda x,y :x^y
#sign = lambda x: math.copysign(1, x)
#list.reverse()
#list.sort() list=sorted(list)
list.sort(key=operator.itemgetter(1,2))
#reverse word word[::-1]
#word.islower()
#word.lower() word.upper()
x = x1 if exp1 else x2
any([false,true])
all([true,false])
"a".isalpha()
"1".isdigit()
int(str,base)
"""

fin=sys.stdin ;fout=sys.stdout
# fin=open('../in','r') ; fout=open('../out','w')
def readline():
    return fin.readline().strip()
def readstrings():
    return fin.readline().strip().split(' ')
def writeline(value):
    fout.write(str(value))
    fout.write("\n")
def read_integers():
    return [int(x) for x in fin.readline().strip().split(' ')]
def read_integer():
    return int(fin.readline().strip())
def end():
    sys.exit()

n=read_integer()
a=read_integers()
b=read_integers()
j=0
for i in range(len(a)):
    if a[i]+a[i]==b[i]:
        j+=a[i]*a[i]
    elif a[i]==1:
        j-=1
    elif a[i]*2>b[i]:
        if b[i]%2==0:
            j+=(b[i]//2)**2
        else:
            j+=(b[i]//2)*(b[i]//2+1)
    else:
        j-=1
print j


from __future__ import division
import sys
from collections import namedtuple #x=namedtuple('point','x y')
from math import *
from collections import deque, OrderedDict #append #popleft
from fractions import gcd
from copy import copy ,deepcopy
from collections import Counter #Counter(list)
import re #re.split("[^a-zA-Z]",text)
# from functools import lru_cache #@lru_cache(maxsize = None)
"""
#reduce(func,list)
#map(func,list)
#filter(func,list)
#xor=lambda x,y :x^y
#sign = lambda x: math.copysign(1, x)
#list.reverse()
#list.sort() list=sorted(list)
list.sort(key=operator.itemgetter(1,2))
#reverse word word[::-1]
#word.islower()
#word.lower() word.upper()
x = x1 if exp1 else x2
any([false,true])
all([true,false])
"a".isalpha()
"1".isdigit()
int(str,base)
"""

fin=sys.stdin ;fout=sys.stdout
# fin=open('../in','r') ; fout=open('../out','w')
def readline():
    return fin.readline().strip()
def readstrings():
    return fin.readline().strip().split(' ')
def writeline(value):
    fout.write(str(value))
    fout.write("\n")
def read_integers():
    return [int(x) for x in fin.readline().strip().split(' ')]
def read_integer():
    return int(fin.readline().strip())
def end():
    sys.exit()

n=read_integer()
a=read_integers()
b=read_integers()
j=0
for i in range(len(a)):
    if a[i]+a[i]==b[i]:
        j+=a[i]*a[i]
    elif a[i]*2>b[i]:
        if b[i]%2==0:
            j+=(b[i]//2)**2
        else:
            j+=(b[i]//2)*(b[i]//2+1)
    else:
        j-=1
print j


from __future__ import division
import sys
from collections import namedtuple #x=namedtuple('point','x y')
from math import *
from collections import deque, OrderedDict #append #popleft
from fractions import gcd
from copy import copy ,deepcopy
from collections import Counter #Counter(list)
import re #re.split("[^a-zA-Z]",text)
# from functools import lru_cache #@lru_cache(maxsize = None)
"""
#reduce(func,list)
#map(func,list)
#filter(func,list)
#xor=lambda x,y :x^y
#sign = lambda x: math.copysign(1, x)
#list.reverse()
#list.sort() list=sorted(list)
list.sort(key=operator.itemgetter(1,2))
#reverse word word[::-1]
#word.islower()
#word.lower() word.upper()
x = x1 if exp1 else x2
any([false,true])
all([true,false])
"a".isalpha()
"1".isdigit()
int(str,base)
"""

fin=sys.stdin ;fout=sys.stdout
# fin=open('../in','r') ; fout=open('../out','w')
def readline():
    return fin.readline().strip()
def readstrings():
    return fin.readline().strip().split(' ')
def writeline(value):
    fout.write(str(value))
    fout.write("\n")
def read_integers():
    return [int(x) for x in fin.readline().strip().split(' ')]
def read_integer():
    return int(fin.readline().strip())
def end():
    sys.exit()

n=read_integer()
a=read_integers()
b=read_integers()
j=0
for i in range(len(a)):
    if a[i]+a[i]==b[i]:
        j+=a[i]*a[i]
    elif a[i]*2>b[i]:
        j+=(b[i]-a[i]) * a[i]
    else:
        j-=1
print j


import sys

n=input()
a=map(int,raw_input().split())
b=map(int,raw_input().split())

j=0

for i in range(n):
    if b[i]<=2*a[i] and b[i]>1:
        j+=(b[i]/2)*(b[i]-b[i]/2)
    else:
        j-=1

print j


n=int(raw_input())
a=map(int,raw_input().split())
b=map(int,raw_input().split())
ans=0
for i in range(n):
    if a[i]*2>=b[i]:
        if b[i]%2:
            ans+=(b[i]/2)*(b[i]/2+1)
        else:
            ans+=(b[i]/2)*(b[i]/2)
    else:
        ans-=1
print ans


n=int(raw_input())
a=map(int,raw_input().split())
b=map(int,raw_input().split())
ans=0
for i in range(n):
    if a[i]*2>=b[i] and b[i]>1:
        ans+=(b[i]/2)*(b[i]-b[i]/2)
    else:
        ans-=1
print ans


n=int(input())
ar=map(int,raw_input().split())
br=map(int,raw_input().split())
sj=0
for i in xrange(n):
    s1=int((ar[i]*ar[i])**(0.5))
    s2=(br[i]-s1)
    if (1<=s1<=ar[i])and(1<=s2<=ar[i]):
        sj+=(s1*s2)
    else:
        sj-=1
print sj


n=int(input())
ar=map(int,raw_input().split())
br=map(int,raw_input().split())
sj=0
for i in xrange(n):
    s1=int(br[i]/2)
    s2=(br[i]-s1)
    if (1<=s1<=ar[i])and(1<=s2<=ar[i]):
        sj+=(s1*s2)
    else:
        sj-=1
print sj


n=int(input())
ar=map(int,raw_input().split())
br=map(int,raw_input().split())
sj=0
for i in xrange(n):
    s1=ar[i]
    s2=(br[i]-ar[i])
    if (1<=s1<=ar[i])and(1<=s2<=ar[i]):
        sj+=(s1*s2)
    else:
        sj-=1
print sj


# CF 229B

def joy(n, A, B):
    ans = 0
    for i in xrange(n):
        if (B[i] == 1):
            ans -= 1
        elif (2*A[i] < B[i]):
            ans -= 1
        elif (2*A[i] == B[i]):
            ans += (A[i])**2
        else:
            if (B[i] % 2 == 0):
                ans += (B[i]/2)**2
            else:
                ans += (B[i]/2)*((B[i]+1)/2)
    return ans

n = raw_input("")
n = int(n)
A = raw_input("").split(' ')
for i in xrange(n):
    A[i] = int(A[i])
B = raw_input("").split(' ')
for i in xrange(n):
    B[i] = int(B[i])
print joy(n, A, B)


n = int(raw_input())
a = map(int, raw_input().split())
b = map(int, raw_input().split())

h = 0 #happiness
for i in xrange(0, n):
	if (2 * a[i] < b[i]) or (b[i] < 2):
		h -=1
	else:
		tmp = b[i] /2
		h += tmp * (b[i] - tmp)

print h


n, joy = int(raw_input()), 0
a, b = map(int, raw_input().split()), map(int, raw_input().split())
for i in range(n):
	if a[i] >= (b[i] + 1) / 2 and b[i] / 2 > 0:
		joy += (b[i] / 2) * ((b[i] + 1) / 2)
	else:
		joy -= 1
print joy


#!/usr/bin/env python

import math

if __name__ == '__main__':
    n = int(raw_input())
    v = map(int, raw_input().split())
    b = map(int, raw_input().split())

    joy = 0
    for i, bi in enumerate(b):
        if bi / 2.0 > float(v[i]):
            joy = -1
        else:
            joy +=  int(math.floor(bi / 2.0) * math.ceil(bi / 2.0))
    if joy < 0:
        print '-1'
    else:
        print joy


#!/usr/bin/env python

import math

if __name__ == '__main__':
    n = int(raw_input())
    v = map(int, raw_input().split())
    b = map(int, raw_input().split())

    joy = 0
    for i, bi in enumerate(b):
        if v[i] * 2 < bi or bi == 1:
            joy -= 1
        else:
            joy +=  int(math.floor(bi / 2.0) * math.ceil(bi / 2.0))
    if joy < 0:
        print '-1'
    else:
        print joy


n, a, b = input(), map(int, raw_input().split()), map(int, raw_input().split())
print sum(y * y - y % 2 if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)) / 4


n, a, b = input(), map(int, raw_input().split()), map(int, raw_input().split())
print sum(y * y - y % 2 if y > 1 and 2 * x >= y else -4 for x, y in zip(a, b)) / 4


import sys
import math

def main():
  notes = int(sys.stdin.readline())
  a_in = sys.stdin.readline().split()
  b_in = sys.stdin.readline().split()
  total = 0

  for i in range(notes):
    a = int(a_in[i])
    b = int(b_in[i])
    if a * 2 < b:
      total -= 1
      continue
    elif b < 2:
      total -= 1
    elif b % 2 == 0:
      total += (b/2)*(b/2)
    else:
      total += ((b-1)/2)*((b-1)/2+1)

  print total

if __name__ == '__main__':
  main()


#Codeforces 390B

def main():
    n = int(raw_input())

    a = map(int, raw_input().split())
    b = map(int, raw_input().split())

    joy = 0

    for i in xrange(n):
        if (b[i] > 2*a[i]) or b[i] == 1:
            joy -= 1
        elif b[i] % 2 == 0:
            joy += (b[i]/2)**2
        else:
            joy += (b[i]/2)*(b[i]/2 + 1)

    print joy

if __name__ == "__main__":
    main()


#!/usr/bin/env python

def read():
    raw_input()
    A = map(int, raw_input().split())
    B = map(int, raw_input().split())
    return (A, B)

def work((A, B)):
    ans = 0
    for i in range(len(A)):
        if A[i] * 2 >= B[i] >= 2:
            ans += (B[i] / 2) ** 2 if B[i] % 2 == 0 else (B[i] / 2) * ((B[i] + 1) / 2)
        else:
            ans -= 1
    print ans

if __name__ == "__main__":
    work(read())


#!/usr/bin/env python

def read():
    raw_input()
    A = map(int, raw_input().split())
    B = map(int, raw_input().split())
    return (A, B)

def work((A, B)):
    ans = 0
    for i in range(len(A)):
        if B[i] % 2 == 0 and A[i] * 2 <= B[i]:
            ans += A[i] + B[i]
        else:
            ans -= 1
    print ans

if __name__ == "__main__":
    work(read())


#!/usr/bin/env python

def read():
    raw_input()
    A = map(int, raw_input().split())
    B = map(int, raw_input().split())
    return (A, B)

def work((A, B)):
    ans = 0
    for i in range(len(A)):
        if A[i] * 2 >= B[i]:
            ans += (B[i] / 2) ** 2 if B[i] % 2 == 0 else (B[i] / 2) * ((B[i] + 1) / 2)
        else:
            ans -= 1
    print ans

if __name__ == "__main__":
    work(read())


#include<stdio.h>
#include<math.h>
int main()
{
    long long int n,i,joy=0;
    scanf("%lld",&n);
    long long int arr[n],brr[n];
    for(i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    for(i=0;i<n;i++)
    {
        scanf("%lld",&brr[i]);
    }
    for(i=0;i<n;i++)
    {
        if(2*arr[i]<brr[i] || (arr[i]==1 &&brr[i]==1))joy--;
        else
        {
            joy+=(int)(ceil(brr[i]/2.0))*(int)(floor(brr[i]/2.0));
        }
    }
    printf("%lld",joy);
}


#include<stdio.h>
#include<math.h>
int main()
{
    long long int n,i,joy=0;
    scanf("%lld",&n);
    long long int arr[n],brr[n];
    for(i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    for(i=0;i<n;i++)
    {
        scanf("%lld",&brr[i]);
    }
    for(i=0;i<n;i++)
    {
        if(2*arr[i]<brr[i] || (brr[i]==1))joy--;
        else
        {
            joy+=(int)(ceil(brr[i]/2.0))*(int)(floor(brr[i]/2.0));
        }
    }
    printf("%lld",joy);
}


#include<stdio.h>
#include<math.h>
int main()
{
    long long int n,i,joy=0;
    scanf("%lld",&n);
    long long int arr[n],brr[n];
    for(i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    for(i=0;i<n;i++)
    {
        scanf("%lld",&brr[i]);
    }
    for(i=0;i<n;i++)
    {
        if(2*arr[i]<brr[i] || (brr[i]==1))joy--;
        else
        {
            joy+=(long long int)(ceil(brr[i]/2.0))*(long long int)(floor(brr[i]/2.0));
        }
    }
    printf("%lld",joy);
}


#include<stdio.h>
#include<math.h>
int main()
{
    long long int n,i,joy=0;
    scanf("%lld",&n);
    long long int arr[n],brr[n];
    for(i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    for(i=0;i<n;i++)
    {
        scanf("%lld",&brr[i]);
    }
    for(i=0;i<n;i++)
    {
        if(2*arr[i]<brr[i])joy--;
        else
        {
            joy+=(int)(ceil(brr[i]/2.0))*(int)(floor(brr[i]/2.0));
        }
    }
    printf("%lld",joy);
}


const readline = require('readline');
//const lineReader = require('fs');
//const scanner = lineReader.createReadStream('main.in');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let n, lp = 0, a, b;

rl.on('line', (input) => {
    if (lp === 0){
        lp = 1;
        n = parseInt(input);
    } else if (lp === 1){
        lp = 2;
        a = input.split(' ').map((x) => {
            return parseInt(x);
        });
    } else if (lp === 2){
        b = input.split(' ').map((x) => {
            return parseInt(x);
        });
        let ck, an = 0;
        for (let i = 0; i < n; i++){
            ck = b[i] - a[i];
            let x;
            if (ck > a[i] || b[i] === 1){
                x = -1;
            } else if (b[i] % 2 === 0){
                x = (b[i] / 2) * (b[i] / 2);
            } else {
                x = Math.floor(b[i] / 2) * Math.ceil(b[i] / 2);
            }
            an += x;
        }
        console.log(an);
        rl.close();
    }

});


const readline = require('readline');
//const lineReader = require('fs');
//const scanner = lineReader.createReadStream('main.in');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let n, lp = 0, a, b;

rl.on('line', (input) => {
    if (lp === 0){
        lp = 1;
        n = parseInt(input);
    } else if (lp === 1){
        lp = 2;
        a = input.split(' ').map((x) => {
            return parseInt(x);
        });
    } else if (lp === 2){
        b = input.split(' ').map((x) => {
            return parseInt(x);
        });
        let ck, an = 0;
        for (let i = 0; i < n; i++){
            ck = b[i] - a[i];
            if (ck < 0){
                console.log(-1);
                process.exit(0);
            } else if (ck > a[i]){
                console.log(-1);
                process.exit(0);
            }
            let x;
            if (b[i] % 2 === 0){
                x = (b[i] / 2) * (b[i] / 2);
            } else {
                x = Math.floor(b[i] / 2) * Math.ceil(b[i] / 2);
            }
            an += x;
        }
        console.log(an);
        rl.close();
    }

});


const readline = require('readline');
//const lineReader = require('fs');
//const scanner = lineReader.createReadStream('main.in');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let n, lp = 0, a, b;

rl.on('line', (input) => {
    if (lp === 0){
        lp = 1;
        n = parseInt(input);
    } else if (lp === 1){
        lp = 2;
        a = input.split(' ').map((x) => {
            return parseInt(x);
        });
    } else if (lp === 2){
        b = input.split(' ').map((x) => {
            return parseInt(x);
        });
        let ck, an = 0;
        for (let i = 0; i < n; i++){
            ck = b[i] - a[i];
            let x;
            if (ck <= 0 || ck > a[i]){
                x = -1;
            } else if (b[i] % 2 === 0){
                x = (b[i] / 2) * (b[i] / 2);
            } else {
                x = Math.floor(b[i] / 2) * Math.ceil(b[i] / 2);
            }
            an += x;
        }
        console.log(an);
        rl.close();
    }

});


const readline = require('readline');
//const lineReader = require('fs');
//const scanner = lineReader.createReadStream('main.in');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let n, lp = 0, a, b;

rl.on('line', (input) => {
    if (lp === 0){
        lp = 1;
        n = parseInt(input);
    } else if (lp === 1){
        lp = 2;
        a = input.split(' ').map((x) => {
            return parseInt(x);
        });
    } else if (lp === 2){
        b = input.split(' ').map((x) => {
            return parseInt(x);
        });
        let ck, an = 0;
        for (let i = 0; i < n; i++){
            ck = b[i] - a[i];
            let x;
            if (ck < 0 || ck > a[i] || a[i] === 1 && b[i] === 1){
                x = -1;
            } else if (b[i] % 2 === 0){
                x = (b[i] / 2) * (b[i] / 2);
            } else {
                x = Math.floor(b[i] / 2) * Math.ceil(b[i] / 2);
            }
            an += x;
        }
        console.log(an);
        rl.close();
    }

});


using System;
using System.Collections.Generic;

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] a = Console.ReadLine().Split(' ');
            string[] b = Console.ReadLine().Split(' ');
            int joy = 0;
            for (int i = 0; i < a.Length; i++)
            {
                if (int.Parse(b[i]) == 1 || int.Parse(b[i]) > int.Parse(a[i]) * 2)
                    joy--;
                else
                {
                    if (int.Parse(b[i]) % 2 == 1)
                    {
                        joy += int.Parse(b[i]) / 2 * (int.Parse(b[i]) + 1) / 2;
                    }
                    else
                    {
                        joy += int.Parse(b[i]) * int.Parse(b[i]) / 4;
                    }
                }
            }
            Console.WriteLine(joy);
        }
    }
}


using System;
using System.Collections.Generic;

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            string[] a = Console.ReadLine().Split(' ');
            string[] b = Console.ReadLine().Split(' ');
            long joy = 0;
            for (long i = 0; i < a.Length; i++)
            {
                if (long.Parse(b[i]) == 1 || long.Parse(b[i]) > long.Parse(a[i]) * 2)
                    joy--;
                else
                {
                    if (int.Parse(b[i]) % 2 == 1)
                    {
                        joy += long.Parse(b[i]) / 2 * (long.Parse(b[i]) + 1) / 2;
                    }
                    else
                    {
                        joy += long.Parse(b[i]) * long.Parse(b[i]) / 4;
                    }
                }
            }
            Console.WriteLine(joy);
            //Console.ReadKey();
        }
    }
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]int64, n)
	b := make([]int64, n)
	for i := 0; i < n-1; i++ {
		fmt.Fscanf(reader, "%d ", &a[i])
	}
	fmt.Fscanf(reader, "%d\n", &a[n-1])
	for i := 0; i < n-1; i++ {
		fmt.Fscanf(reader, "%d ", &b[i])
	}
	fmt.Fscanf(reader, "%d\n", &b[n-1])
	var ans int64
	for i := 0; i < n; i++ {
		if 2*a[i] < b[i] {
			ans--
		} else if b[i]%2 == 0 {
			ans += (b[i] / 2) * (b[i] / 2)
		} else {
			ans += (b[i] / 2) * (b[i]/2 + 1)
		}
	}
	fmt.Printf("%d", ans)
}


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
)

func main() {
	bs, _ := ioutil.ReadAll(os.Stdin)
	reader := bytes.NewBuffer(bs)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]int64, n)
	b := make([]int64, n)
	for i := 0; i < n-1; i++ {
		fmt.Fscanf(reader, "%d ", &a[i])
	}
	fmt.Fscanf(reader, "%d\n", &a[n-1])
	for i := 0; i < n-1; i++ {
		fmt.Fscanf(reader, "%d ", &b[i])
	}
	fmt.Fscanf(reader, "%d\n", &b[n-1])
	var ans int64
	for i := 0; i < n; i++ {
		if 2*a[i] < b[i] || b[i] == 1 {
			ans--
		} else if b[i]%2 == 0 {
			ans += (b[i] / 2) * (b[i] / 2)
		} else {
			ans += (b[i] / 2) * (b[i]/2 + 1)
		}
	}
	fmt.Printf("%d", ans)
}


package main

import (
	"fmt"
	"bufio"
	"os"
	"io"
	"strconv"
	// "time"
)

func main() {
	// defer func(start time.Time) {
	// 	fmt.Println(time.Since(start))
	// }(time.Now())

	scanner := NewScanner(os.Stdin)
	n := scanner.nextInt()

	a, b := make([]int, n), make([]int, n)

	for i := range a {
		a[i] = scanner.nextInt()
	}

	for i := range b {
		b[i] = scanner.nextInt()
	}

	var joy int64 = 0
	var x, y int = 0, 0

	for i := range a {
		if b[i]==1 || a[i]*2 < b[i] {
			joy--
			continue
		}
		if b[i]%2==0 {
			x = b[i]/2
			y = x
		} else {
			x = b[i]/2
			y = x+1
		}
		joy += int64(x)*int64(y)
	}

	fmt.Println(joy)
}

type Scanner struct {
	scanner *bufio.Scanner
}

func NewScanner(r io.Reader) *Scanner {
	scanner := bufio.NewScanner(r)
	scanner.Split(bufio.ScanWords)

	return &Scanner{
		scanner: scanner,
	}
}

func (s *Scanner) next() string {
	ok := s.scanner.Scan()
	if !ok {
		panic("Scan error")
	}
	return s.scanner.Text()
}

func (s *Scanner) nextInt() int {
	n, err := strconv.Atoi(s.next())
	if err!=nil {
		panic(err)
	}
	return n
}

func (s *Scanner) nextInt64() int64 {
	n, err := strconv.ParseInt(s.next(), 10, 64)
	if err!=nil {
		panic(err)
	}
	return n

}

func (s *Scanner) SetScanLines() {
	s.scanner.Split(bufio.ScanLines)
}

func (s *Scanner) SetScanWords() {
	s.scanner.Split(bufio.ScanWords)
}


<?php
error_reporting("off");
//390B: Inna, Dima, and Song
$n = trim(fgets(STDIN));
$a = explode(" ", trim(fgets(STDIN)));
$b = explode(" ", trim(fgets(STDIN)));
$joy = 0;
for ($i = 0; $i < $n; $i++) {
	$max = $a[$i];
	$vol = $b[$i];
	if ($max * 2 >= $vol && $vol > 1) {
		if ($vol % 2 == 0) {
			$tosquare = $vol / 2;
			$joyadd = pow($tosquare, 2);
			$joy += $joyadd;
		} else {
			$down = floor($vol / 2);
			$up = ceil($vol / 2);
			$joy += $up * $down;
		}
	} else {
		$joy--;
	}
}
echo implode(explode(",", number_format($joy, 0)));
?>


input()
print(sum(-1 if (b>2*a or b==1) else (b//2)*((b+1)//2) for a,b in zip(map(int,raw_input().split()),map(int,raw_input().split()))))


input()
print(sum(-1 if b>2*a and b>1 else (b//2)*((b+1)//2) for a,b in zip(map(int,raw_input().split()),map(int,raw_input().split()))))


input()
print(sum(-1 if b>2*a else (b//2)*((b+1)//2) for a,b in zip(map(int,raw_input().split()),map(int,raw_input().split()))))


input()
print(sum(-1 if b>2*a else (b//2)*((b+1)//2) for a,b in zip(map(int,raw_input().split()),map(int,raw_input().split())))%(10**9+7))


n = int(raw_input())
a = map(int, raw_input().split())
b = map(int, raw_input().split())
ans = 0
for i in xrange(n):
	if (a[i]*2 < b[i] or a[i]==b[i]==1):
		ans -= 1
	else:
		ans += (b[i]//2)*((b[i]//2) + b[i]%2)
print(ans)


n = int(raw_input())
a = map(int, raw_input().split())
b = map(int, raw_input().split())
ans = 0
for i in xrange(n):
	if (a[i]*2 < b[i]):
		ans -= 1
	else:
		ans += (b[i]//2)*((b[i]//2) + b[i]%2)
print(ans)


n = int(raw_input())
a = map(int, raw_input().split())
b = map(int, raw_input().split())
ans = 0
for i in xrange(n):
	if (a[i]*2 < b[i] or b[i]==1):
		ans -= 1
	else:
		ans += (b[i]//2)*((b[i]//2) + b[i]%2)
print(ans)


n, a, b = input(), map(int, input().split()), map(int, input().split())
print(sum((y // 2) * (y - y // 2) if y > 1 and 2 * x >= y else -1 for x, y in zip(a, b)))


n = int(input())

a = [int(ai) for ai in input().split()]
b = [int(bi) for bi in input().split()]

joy = 0
for i in range(n):
    if 2*a[i]>=b[i] and b[i]>1:
        if b[i]%2==0:
            joy+=(b[i]*b[i]/4)
        else:
            joy+=(b[i]-1)*(b[i]+1)/4
    else:
        joy-=1

print(int(joy))


n = int(input())

a = [int(ai) for ai in input().split()]
b = [int(bi) for bi in input().split()]

joy = 0
for i in range(n):
    if 2*a[i]>=b[i]:
        if b[i]%2==0:
            joy+=(b[i]*b[i]/4)
        else:
            joy+=(b[i]-1)*(b[i]+1)/4
    else:
        joy-=1

print(int(joy))


n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = 0
for i in range(n):
    if 2 * a[i] >= b[i]:
        x = b[i] // 2
        ans += (x * (b[i] - x))
    else:
        ans -= 1
print(ans)


n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = 0
for i in range(n):
    if 2 * a[i] >= b[i] and b[i] > 1:
        x = b[i] // 2
        ans += (x * (b[i] - x))
    else:
        ans -= 1
print(ans)


input()
anotes=input().split(' ')
bnotes=input().split(' ')
joy=0
for i in range(0,len(anotes)):
    if int(bnotes[i])>1 and int(anotes[i])*2>=int(bnotes[i]):
        joy += int(bnotes[i])//2*(int(bnotes[i])//2+int(bnotes[i])%2)
    else:
        joy -= 1
print(joy)


input()
anotes=input().split(' ')
bnotes=input().split(' ')
joy=0
for i in range(0,len(anotes)):
    if int(bnotes[i])>1 and int(anotes[i])*2>=int(bnotes[i]):
        joy += int(bnotes[i])//2*(int(bnotes[i])//2+int(bnotes[i])%2)
        print(joy)
    else:
        joy -= 1
print(joy)


input()
anotes=input().split(' ')
bnotes=input().split(' ')
joy=0
for i in range(0,len(anotes)):
    if int(anotes[i])*2>=int(bnotes[i]):
        joy += int(bnotes[i])//2*(int(bnotes[i])//2+int(bnotes[i])%2)
    else:
        joy -= 1
print(joy)


input()
anotes = input().split(' ')
bnotes = input().split(' ')
joy = 0
for i in range(0, len(anotes)):
    if int(bnotes[i]) > 1 and int(anotes[i]) * 2 >= int(bnotes[i]):
        joy += int(bnotes[i]) // 2 * (int(bnotes[i]) // 2 + int(bnotes[i]) % 2)
    else:
        joy -= 1
print(joy)


def main():

    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    joy = 0

    for i in range(n):
        temp2 = (b[i]+1)//2
        if(a[i] >= temp2 and b[i] != 1):
            temp1 = b[i]//2

            joy += (temp1 * temp2)
            print("if", b[i])

        elif(a[i]*2 < b[i] or b[i] == 1):
            joy -= 1
            print("lol")

        else:
            temp1 = a[i]
            temp2 = a[i]

            joy += (temp1 * temp2)

    print(joy)

if __name__ == "__main__":
    main()


def main():

    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    joy = 0

    for i in range(n):
        temp2 = (b[i]+1)//2
        if(a[i] >= temp2):
            temp1 = b[i]//2

            joy += (temp1 * temp2)

        elif(a[i]*2 < b[i]):
            joy -= 1

        else:
            temp1 = a[i]
            temp2 = a[i]

            joy += (temp1 * temp2)

    print(joy)

if __name__ == "__main__":
    main()


def main():

    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    joy = 0

    for i in range(n):
        temp2 = (b[i]+1)//2
        if(a[i] >= temp2 and b[i] != 1):
            temp1 = b[i]//2

            joy += (temp1 * temp2)

        elif(a[i]*2 < b[i] or b[i] == 1):
            joy -= 1

        else:
            temp1 = a[i]
            temp2 = a[i]

            joy += (temp1 * temp2)

    print(joy)

if __name__ == "__main__":
    main()


n=int(input())
l=list(map(int,input().split()))
x=list(map(int,input().split()))
count=0
for i in range(len(l)):
    if x[i]-l[i]<=l[i]:
        count+=(l[i]*(x[i]-l[i]))
    else:
        count-=1
print(count)


input()
print(sum(-1 if (b>2*a or b==1) else ((b//2)*((b+1)//2)) for a,b in zip(map(int,input().split()),map(int,input().split()))))


n=int(input())
l=list(map(int,input().split()))
x=list(map(int,input().split()))
count=0
for i in range(len(l)):
    if l[i]>x[i]:
        count-=1
    else:
        count+=(int(l[i]//2)*(l[i]-int(l[i]//2)))
    if x[i]-l[i]<=l[i]:
        count+=(l[i]*(x[i]-l[i]))
    else:
        count-=1
print(count)


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n+1];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	ll c;
	for(ll i=1;i<=n;i++)
	{
		if(isPrime(a[i]))
		{
			a[i]=1;
			c=1;
		}
		else
		{
			c=2;
			a[i]=2;
		}
	}
	if(n==1)
	{
		cout<<1<<'\n';
		cout<<1<<'\n';
		return 0;
	}
	cout<<c<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n+1];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	ll c=0;
	for(ll i=1;i<=n;i++)
	{
		if(isPrime(a[i]))
		{
			a[i]=1;
			if(c==0)c=1;
		}
		else
		{
			c=2;
			a[i]=2;
		}
	}
	if(n==1)
	{
		cout<<1<<'\n';
		cout<<1<<'\n';
		return 0;
	}
	cout<<c<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	for(ll i=1;i<=n;i++)
	{
		if(isPrime(a[i]))
		{
			a[i]=1;
		}
		else
		{
			a[i]=2;
		}
	}
	if(n==1)
	{
		cout<<1<<'\n';
		cout<<1<<'\n';
		return 0;
	}
	cout<<2<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}

int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n+1];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	for(ll i=1;i<=n;i++)
	{
		if(a[i]%2==0 && a[i]!=2)a[i]=1;
		else if (a[i]%2==0 && a[i]==2)a[i]=2;
		else a[i]=2;
	}
	cout<<2<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n+1];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	for(ll i=1;i<=n;i++)
	{
		if(isPrime(a[i]))
		{
			a[i]=1;
		}
		else
		{
			a[i]=2;
		}
	}
	cout<<2<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	for(ll i=1;i<=n;i++)
	{
		if(isPrime(a[i]))
		{
			a[i]=1;
		}
		else
		{
			a[i]=2;
		}
	}
	cout<<2<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}

int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	for(ll i=1;i<=n;i++)
	{
		if(a[i]%2==0 && a[i]!=2)a[i]=1;
		else if (a[i]%2==0 && a[i]==2)a[i]=2;
		else a[i]=2;
	}
	cout<<2<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


//-.-.-.-.-.-.-.-.-.-Make it Work, Make it Right, Make it Fast-.-.-.-.-.-.-.-.-.-.-.-.-.
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pob pop_back
#define pf push_front
#define popb pop_back()
#define popf pop_front()
#define ll long long int
#define llu long long unsigned int
#define lu long unsigned int
#define ff first
#define ss second
#define S size()
#define inf 1e8
#define MOD 1000000007
#define clr(a) memset(a,0, sizeof(a))
#define fr(i, x, y) for ( ll i = x; i < y;i++)
#define dc(i, x, y) for ( ll i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define PI 3.1415926535897932384626433832795
#define pqueue priority_queue<ll>
#define piqueue priority_queue<ll,vll ,greater<ll>>
#define mapcl map<char,ll>
#define mapll map<ll,ll>
#define mapsl map<string,ll>
#define vi vector<ll>
#define vs vector<string>
#define pii pair<ll,ll>
#define piii pair<ll,pii>
#define vii vector<pii>
using namespace std;
void fast(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//----------------------------------------FUNCTIONS-------------------------------------
ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll a, ll b){
    return (a*b)/gcd(a, b);
}
void out(vi a){
    for(int i=0;i<(ll)a.S;i++){
        cout<<a[i]<<' ';
    }
    cout<<'\n';
}
void        in(ll *a, ll n)        {for(ll i=0;i<n;i++)cin>>a[i];}
void out(ll *a,ll n){fr(i,0,n){cout<<a[i]<<" ";}}
//----------------------------------------START-------------------------------------------
int solve();
vi primes;
void sieve(ll n){
    vector<bool> prime(n+1,true);
    for(ll p = 2; p * p <= n; p++){
        if(prime[p] == true){
            for (ll i = p*2; i <= n; i += p)
                prime[i] = false;
        }
    }

    for (int p = 2; p <= n; p++)
       if(prime[p])
          primes.pb(p);
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int main()
{
	fast();
	ll t=1;
	//sieve(100000)
	while(t--)
	{
		solve();
	}
}

int solve()
{
	ll n;
	cin>>n;
	ll a[n+1];
	fr(i,1,n+1)
	{
		a[i]=i+1;
	}
	for(ll i=1;i<=n;i++)
	{
		if(isPrime(a[i]))
		{
			a[i]=1;
		}
		else
		{
			a[i]=2;
		}
	}
	if(n==1)
	{
		cout<<1<<'\n';
		cout<<1<<'\n';
		return 0;
	}
	cout<<2<<'\n';
	fr(i,1,n+1)cout<<a[i]<<" ";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int ans[100099];

void pre(int n){
	int maxi=-1;
	for(int i=2;i<=n+1;i++){
		if(ans[i]==0){
			int c=1;
			for(int j=i;j<=n+1;j+=i){
				ans[j]=c;
				c++;
			}
			maxi=max(maxi,c-1);
		}
	}
	cout<<maxi<<"\n";
	for(int i=2;i<=n+1;i++)
		cout<<ans[i]<<" ";
}

int main(){

	int n;
	cin>>n;
	pre(n);

}


#include <bits/stdc++.h>
using namespace std;

int ans[100099];

void pre(int n){
	for(int i=2;i<=n+1;i++){
		if(ans[i]==0){
			int c=1;
			for(int j=i;j<=n+1;j+=i){
				ans[j]=c;
				c++;
			}
		}
	}
	for(int i=2;i<=n+1;i++)
		cout<<ans[i]<<" ";
}

int main(){

	int n;
	cin>>n;
	pre(n);

}


#include <bits/stdc++.h>
using namespace std;

int ans[100099];

void pre(int n){
	int maxi=-1;
	for(int i=2;i<=n+1;i++){
		if(ans[i]==0){
			int c=1;
			for(int j=i;j<=n+1;j+=i){
				ans[j]=c;
				c++;
			}
			maxi=max(maxi,c);
		}
	}
	cout<<maxi<<"\n";
	for(int i=2;i<=n+1;i++)
		cout<<ans[i]<<" ";
}

int main(){

	int n;
	cin>>n;
	pre(n);

}


#include <bits/stdc++.h>
using namespace std;

int ans[100099];

void pre(int n){
	int maxi=-1;
	for(int i=2;i<=n+1;i++){
			for(int j=i*2;j<=n+1;j+=i){
				ans[j]=1;
		}
	}
	cout<<"2"<<"\n";
	for(int i=2;i<=n+1;i++){
		if(ans[i]!=1){
			cout<<"2"<<" ";
		}
		else{
			cout<<"1"<<" ";
		}
	}
}

int main(){

	int n;
	cin>>n;
	if(n==1){
		cout<<"1\n";
		cout<<"1";
		return 0;
	}
	if(n==2){
		cout<<"1\n";
		cout<<"1 1";
		return 0;
	}
	pre(n);

}


#include <bits/stdc++.h>
using namespace std;

int ans[100099];

void pre(int n){
	int maxi=-1;
	for(int i=2;i<=n+1;i++){
			for(int j=i*2;j<=n+1;j+=i){
				ans[j]=1;
		}
	}
	cout<<"2"<<"\n";
	for(int i=2;i<=n+1;i++){
		if(ans[i]!=1){
			cout<<"2"<<" ";
		}
		else{
			cout<<"1"<<" ";
		}
	}
}

int main(){

	int n;
	cin>>n;
	if(n==1){
		cout<<"1\n";
		cout<"1";
		return 0;
	}
	pre(n);

}


#include <bits/stdc++.h>
using namespace std;

int ans[100099];

void pre(int n){
	int maxi=-1;
	for(int i=2;i<=n+1;i++){
			for(int j=i*2;j<=n+1;j+=i){
				ans[j]=1;
		}
	}
	cout<<"2"<<"\n";
	for(int i=2;i<=n+1;i++){
		if(ans[i]!=1){
			cout<<"2"<<" ";
		}
		else{
			cout<<"1"<<" ";
		}
	}
}

int main(){

	int n;
	cin>>n;
	if(n==1){
		cout<<"1\n";
		cout<<"1";
		return 0;
	}
	pre(n);

}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100000;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2;
    for(int i=2;i<=n+1;i++){
        if(!notPrime)cout<<"1 ";
        else cout<<"2 ";
    }
    system("pause");
	return 0;
}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100000;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2;
    for(int i=2;i<=n+1;i++){
        if(!notPrime)cout<<"1 ";
        else cout<<"2 ";
    }
   // system("pause");
	return 0;
}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100003;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	if(n==1){
        cout<<1<<endl<<1;
        return 0;
    }
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2<<endl;
    for(int i=2;i<=n+1;i++){
        if(!notPrime[i])cout<<"1 ";
        else cout<<"2 ";
    }
  //  system("pause");
	return 0;
}
＿


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100000;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	if(n==1){
        cout<<1<<endl<<1;
        return 0;
    }
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2<<endl;
    for(int i=2;i<=n+1;i++){
        if(!notPrime[i])cout<<"1 ";
        else cout<<"2 ";
    }
  //  system("pause");
	return 0;
}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100000;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2<<endl;
    for(int i=2;i<=n+1;i++){
        if(!notPrime[i])cout<<"1 ";
        else cout<<"2 ";
    }
  //  system("pause");
	return 0;
}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100003;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	if(n==1){
        cout<<1<<endl<<1;
        return 0;
    }
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2<<endl;
    for(int i=2;i<=n+1;i++){
        if(!notPrime[i])cout<<"1 ";
        else cout<<"2 ";
    }
  //  system("pause");
	return 0;
}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100000;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2<<endl;
    for(int i=2;i<=n+1;i++){
        if(!notPrime[i])cout<<"1 ";
        else cout<<"2 ";
    }
    system("pause");
	return 0;
}


#include<iostream>
#include<stdio.h>

using namespace std;
const int MAX_N=100003;
bool notPrime[MAX_N];
void initPrime(){
	notPrime[0]=notPrime[1]=true;
	for(int i=2;i<MAX_N;i++){
		if(!notPrime[i]){
			for(int j=2*i;j<MAX_N;j+=i)
				notPrime[j]=true;
		}
	}
}
int main(){
    initPrime();
	int n,prime=0;
	cin>>n;
	if(n==1){
        cout<<1<<endl<<1;
        return 0;
    }
    if(n==2){
        cout<<1<<endl<<"1 1";
        return 0;
    }
	/*for(int i=2;i<=n+1;i++){
        if(!notPrime[i]){
            prime++;
        }
    }
    cout<<prime;*/
    cout<<2<<endl;
    for(int i=2;i<=n+1;i++){
        if(!notPrime[i])cout<<"1 ";
        else cout<<"2 ";
    }
  //  system("pause");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	f(i, 2, a)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	int x = (n+1)/log(n+1);
	if(n == 1)
	cout << 1 << endl;
	else
	cout << 2 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << 2 << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	for(int i = 2;i <= sqrt(a);i++)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	int x = (n+1)/log(n+1);
	if(n == x)
	cout << 1 << endl;
	else
	cout << 2 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << 2 << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	f(i, 2, a)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	int x = (n+1)/log(n+1);
	cout << n - x + 1 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << k << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	for(int i = 2;i <= sqrt(a);i++)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	int x = (n+1)/log(n+1);
	if(n == 1)
	cout << 1 << endl;
	else
	cout << 2 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << 2 << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	for(int i = 2;i <= sqrt(a);i++)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	if(n <= 2)
	cout << 1 << endl;
	else
	cout << 2 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << 2 << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	f(i, 2, a/2+1)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	int x = (n+1)/log(n+1);
	if(n == 1)
	cout << 1 << endl;
	else
	cout << 2 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << 2 << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lli;
#define f(i, x, n);for(lli i = x;i < n;i++)
bool is_prime(int a)
{
	f(i, 2, a)
	{
		if(a%i == 0)
		return false;
	}
	return true;
}

int main()
{
	int n;
	cin >> n;
	int x = (n+1)/log(n+1);
	cout << 2 << endl;
	int k = 2;
	f(i, 2, n+2)
	{
		if(is_prime(i))
		{
			cout << 1 << " ";
		}
		else
		{
			cout << 2 << " ";
			k++;
		}
	}

}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = i*2-1; j <=n+1; j+=i)
    {
     vis[j]++;
     a[j-1]++;

    }
  }
  x = *max_element(a.begin(), a.end());

  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2); j <=n+1; j+=i)
    {
     vis[j]++;
     a[j-1]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2)-1; j <=n+1; j+=i)
    {
     vis[j+1]++;
     a[j]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2)-1; j <=n+1; j+=i)
    {
     vis[j]++;
     a[j]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2); j <=n+1; j+=i)
    {
      if(vis[j])continue;
     vis[j]++;
     a[j-1]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2); j <=n+1; j+=i)
    {
     vis[j]++;
     a[i-1]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2); j <=n+1; j+=i)
    {
     vis[j]++;
     a[i]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)

const ll N   =  100005;
const ll mod = 1e9 + 7;

using namespace std;
std::vector<ll> vp;
std::vector<ll> vis(N);

void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n;
  std::vector<ll> a(n+10,1);
  for (ll i = 2; i <= n; ++i)
  {
    if(vis[i])continue;

    for (int j = (i*2)-1; j <=n; j+=i)
    {
     vis[j+1]++;
     a[j]++;

    }
  }
  x = *max_element(a.begin(), a.end());
c(x);
  for (int i = 1; i <= n; ++i)
  {
    cout<<a[i]<<" ";
  }
}

signed main(){

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  //cin>>T;
  while(T--){
  solve();
  }
  return 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  long n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1 && i*i <= n)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}

	R 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  long n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1 && i*i <= n + 1)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}

	R 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  long long n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1 && i*i <= n + 1)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}

	R 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  long n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}

	R 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  int n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}
	R 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  int n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}

	R 0;
}


#include<bits/stdc++.h>
using  namespace std;

#define F first
#define S second
#define ff(i , l , n) for(i = l ; i < n ; i ++)
#define fr(i , l , n) for(i = n ; i > l ; i--)
#define fast ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
#define R return
#define B break
#define C continue
#define vi vector<int>
#define vl vector<long>
#define vll vector<long long >
#define vpii vector < pair <int , int > >

int main()
{
   int t = 1;
   //cin>>t;
   while(t--)
{
  long n , i , c = 0 , j ;
  cin>>n;
  vi a(n + 3 , 1);
  ff(i , 2 , n + 2)
  {
  	if(a[i] == 1 && i*i < n)
  	for(j = i*i ; j < n + 2; j += i)
  	a[j] = 2;
  }
  if(n < 3)
  cout<<"1\n";
  else cout<<"2\n";

  ff(i , 2 , n + 2)
  cout<<a[i]<<" ";
}

	R 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=1e5+5;
int a[N];

int main(){
	long long n,i,j;
	scanf("%d",&n);
	for(i=2;i<=n+1;i++){
		if(!a[i]){
			a[i]=1;
			for(j=i+i;j<=n+1;j+=i){
				if(!a[j])
					a[j]=2;
			}
		}
	}

	printf("%d\n",n>=3?2:1);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	int mcolor;
	if(n>=3)
		mcolor=2;
	else
		mcolor=1;
	for(int i=2;i<=n+1;i++){
		if(prime[i]){
			int col=1;
			a[i]=col;
			int count;
			count=(n+1)/i;
			for(int j=i*i;j<=n+1;j+=i){
				a[j]=2;
			}
		}
	}
	printf("%d\n",mcolor);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	printf("%d\n",n>=3?2:1);
	for(int i=2;i<=n+1;i++){
		if(prime[i])
			printf("1 ");
		else
			printf("2 ");
	}
	printf("\n");
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=1e5+5;
int a[N];

int main(){
	int n,i,j;
	scanf("%d",&n);
	for(i=2;i<=n+1;i++){
		if(!a[i]){
			a[i]=1;
			for(j=i+i;j<=n+1;j+=i){
				if(!a[j])
					a[j]=2;
			}
		}
	}

	printf("%d\n",n>=3?2:1);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	int mcolor=1;
	for(int i=2;i<=n+1;i++){
		if(prime[i]){
			int col=1;
			a[i]=col;
			int count;
			count=(n+1)/i;
			if(count>mcolor)
				mcolor=count;
			for(int j=i*i;j<=n+1;j+=i){
				if(!a[j])
					a[j]=++col;
			}
		}
	}
	printf("%d\n",mcolor);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=1e5+5;
int a[N];

int main(){
	long long n,i,j;
	scanf("%d",&n);
	for(i=2;i<=n+1;i++){
		if(!a[i]){
			a[i]=1;
			for(j=i*i;j<=n+1;j+=i){
				if(!a[j])
					a[j]=2;
			}
		}
	}

	printf("%d\n",n>=3?2:1);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	int mcolor=1;
	for(int i=2;i<=n+1;i++){
		if(prime[i]){
			int col=1;
			a[i]=col;
			int count;
			count=(n+1)/i;
			if(count>mcolor)
				mcolor=count;
			for(int j=i*i;j<=n+1;j+=i){
				if(!a[j]){
					if(++col%2==0)
						a[j]=2;
					else
						a[j]=1;
				}

			}
		}
	}
	printf("%d\n",mcolor);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	int mcolor;
	if(n>=3)
		mcolor=2;
	else
		mcolor=1;
	for(int i=2;i<=n+1;i++){
		if(prime[i]){
			int col=1;
			a[i]=col;
			int count;
			count=(n+1)/i;
			for(int j=i*i;j<=n+1;j+=i){
				if(!a[j]){
					if(++col%2==0)
						a[j]=2;
					else
						a[j]=1;
				}

			}
		}
	}
	printf("%d\n",mcolor);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	printf("%d\n",n>3?2:1);
	for(int i=2;i<=n+1;i++){
		if(prime[i])
			printf("1 ");
		else
			printf("2 ");
	}
	printf("\n");
}


#include<iostream>
#include<cstring>
using namespace std;
const int N=1e5+5;
bool prime[N];
int a[N];

void Prime_init(){
	for(int i=2;i<N;i++){
		prime[i]=true;
	}
	for(int i=2;i*i<N;i++){
		if(prime[i]){
			for(int j=i*i;j<N;j+=i){
				prime[j]=false;
			}
		}
	}
}

int main(){
	Prime_init();
	int n;
	scanf("%d",&n);
	int mcolor;
	if(n>=3)
		mcolor=2;
	else
		mcolor=1;
	for(int i=2;i<=n+1;i++){
		if(prime[i]){
			int col=1;
			a[i]=col;
			int count;
			count=(n+1)/i;
			for(int j=2*i;j<=n+1;j+=i){
					if(++col%2==0)
						a[j]=2;
					else
						a[j]=1;
			}
		}
	}
	printf("%d\n",mcolor);
	for(int i=2;i<=n+1;i++){
		printf("%d ",a[i]);
	}
	printf("\n");
}


#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	int maxno = 1;
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				color[j] = c++;
				maxno = max(maxno,color[j]);
				//cnt++;
			}
		}
	}
	cout << maxno << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				color[j] = c++;
				cnt++;
			}
		}
	}
	cout << cnt << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	//int maxno = 1;
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				color[j] = c++;
				//maxno = max(maxno,color[j]);
				//cnt++;
			}
		}
	}
	map<int,int> mp;
	for (int i = 2; i <= n+1; i++){
		mp[color[i]]++;
	}
	cout << mp.size() << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	/*for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				if (color[j] == 0) color[j] = c++;
				//maxno = max(maxno,color[j]);
				//cnt++;
			}
		}
	}
	map<int,int> mp;
	for (int i = 2; i <= n+1; i++){
		mp[color[i]]++;
	}
	cout << mp.size() << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl; */
	if (n == 1 || n == 2){
		cout << 1 << endl;
	}else if (n > 2){
		cout << 2 << endl;
	}
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]) cout << 1 << " ";
		else cout << 2 << " ";
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	/*for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				if (color[j] == 0) color[j] = c++;
				//maxno = max(maxno,color[j]);
				//cnt++;
			}
		}
	}
	map<int,int> mp;
	for (int i = 2; i <= n+1; i++){
		mp[color[i]]++;
	}
	cout << mp.size() << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl; */
	cout << 2 << endl;
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]) cout << 1 << " ";
		else cout << 2 << " ";
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	int maxno = 1;
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				color[j] = c++;
				//maxno = max(maxno,color[j]);
				//cnt++;
			}
		}
	}
	for (int i = 2; i <= n+1; i++){
		maxno = max(maxno,color[i]);
	}
	cout << maxno << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
#include <map>
#include <algorithm>
#include <numeric>
using namespace std;

int color[100005];
int isPrime[100005];

void sieve(){
	for (int i = 0; i < 100005; i++){
		isPrime[i] = 1;
	}
	isPrime[0] = isPrime[1] = 0;
	for (int i = 2; i*i <= 100005; i++){
		if (isPrime[i]){
			for (int j = i*i; j <= 100005; j += i){
				isPrime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, cnt = 1;
	cin >> n;
	sieve();
	// set all prime number to color 1.
	//int maxno = 1;
	for (int i = 2; i <= n+1; i++){
		if (isPrime[i]){ // if i is prime, then cross off all
			color[i] = 1;
			int c = 2;
			for (int j = 2*i; j <= n+1; j += i){
				if (color[j] == 0) color[j] = c++;
				//maxno = max(maxno,color[j]);
				//cnt++;
			}
		}
	}
	map<int,int> mp;
	for (int i = 2; i <= n+1; i++){
		mp[color[i]]++;
	}
	cout << mp.size() << endl;
	for (int i = 2; i <= n+1; i++){
		cout << color[i] << " ";
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+2,0);
    primes[0]=primes[1]=1;
    int min_color=1,color=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=1;
            for(int j=i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                    ++color;
                    primes[j]=color;
                    min_color++;
                }
            }
        }
    }
    cout<<min_color<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+2,0);
    primes[0]=primes[1]=1;
    int min_color=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=2;
            for(int j=i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                    primes[j]=j+1;
                    min_color++;
                }
            }
        }
    }
    cout<<min_color<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+1,0);
    primes[0]=primes[1]=1;
    int min_color=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=2;
            for(int j=i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                    primes[j]=j+1;
                    min_color++;
                }
            }
        }
    }
    cout<<min_color<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+2,0);
    primes[0]=primes[1]=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=1;
            for(int j=i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                   // ++color;
                    primes[j]=2;
                    //min_color++;
                }
            }
        }
    }
    cout<<2<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+1,0);
    primes[0]=primes[1]=1;
    int min_color=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=2;
            for(int j=i*i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                    primes[j]=j+1;
                    min_color++;
                }
            }
        }
    }
    cout<<min_color<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+2,0);
    primes[0]=primes[1]=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=1;
            for(int j=i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                   // ++color;
                    primes[j]=2;
                    //min_color++;
                }
            }
        }
    }
    if(n==1 || n==2)cout<<1<<endl;
    else
     cout<<2<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(0);
using namespace std;
int main()
{

    int n;
    cin>>n;
    vector<int> primes(n+2,0);
    primes[0]=primes[1]=1;
    for(int i=2;i<=n+1;++i)
    {
        if(!primes[i])
        {
            primes[i]=1;
            for(int j=i;j<=n+1;j+=i)
            {
                if(!primes[j])
                {
                   // ++color;
                    primes[j]=2;
                    //min_color++;
                }
            }
        }
    }
    if(n==1)cout<<1<<endl;
    else
     cout<<2<<endl;
    for(int i=2;i<=n+1;++i)cout<<primes[i]<<" ";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 100050;

int c[N];

int main()
{
    int n;
    scanf("%d",&n);
    for(int i = 2;i <= n + 1; ++i)
        c[i] = 1;
    int ans = 1;
    for(ll i = 2;i <= n + 1; ++i)
    {
        for(ll j = i * 2;j <= n + 1;j += i)
            ++c[j];
        ans = max(ans,c[i]);
    }
    printf("%d\n",ans);
    for(int i = 2;i <= n + 1; ++i)
        printf("%d%s",c[i],i == n + 1 ? "\n" : " ");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 100050;

int c[N];
bool isprime[N];
vector<int> prime;

void init()
{
    memset(isprime,false,sizeof(isprime));
    for(ll i = 2;i < N; ++i)
    {
        if(isprime[i]) continue;
        prime.push_back(i);
        for(ll j = i * i;j < N; j += i)
            isprime[j] = true;
    }
}

int main()
{
    int n;
    init();
    while(scanf("%d",&n)!=EOF)
    {
        for(int i = 0;i < n; ++i)
        {
            int v = i + 2;
            int len = prime.size();
            c[i] = 0;
            for(int j = 0;j < len; ++j)
            {
                int p = prime[j];
                if(p > v) break;
                while(v % p == 0)
                {
                    v /= p;
                    ++c[i];
                }
            }
        }
        for(int i = 0;i < n; ++i)
            printf("%d%s",c[i],i == n - 1 ? "\n" : " ");
    }
    return 0;
}