Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (*x*, *y*), he can move to (or attack) positions (*x* + 1, *y*), (*x*–1, *y*), (*x*, *y* + 1) and (*x*, *y*–1).

Iahub wants to know how many Coders can be placed on an *n* × *n* chessboard, so that no Coder attacks any other Coder.
The first line contains an integer *n* (1 ≤ *n* ≤ 1000).
'''a=[int(i) for i in input().split()]
x=a[0]
y=a[1]
z=a[2]
if y==x and z==0:
    print('0')
elif x>y+z:
    print('+')
elif y>x+z:
    print('-')
else:
    print('?')
n=int(input())
z=[int(i) for i in input().split()]
x=[]
d=0
v=''
for i in range(n):
    c=0
    e=0
    for f in range(len(z)):
        if z[f]>c and f+1 not in x:
            c=z[f]
            e=f+1
    d+=(i*c)+1
    x.append(e)
print(d)
for i in x:
    v+=str(i)
    v+=' '
print(v)

f=int(input())
g=[int(i) for i in input().split()]
for i in range(len(g)-1):
    for f in range(len(g)-1-i):
        if g[f]>g[f+1]:
            g[f],g[f+1]=g[f+1],g[f]
if g[0]*g[1]>g[-2]*g[-3] and g[-1]>0:
    print(g[-1]*g[0]*g[1])
else:
    print(g[-1]*g[-2]*g[-3])
for u in range(int(input())):
    z=int(input())
    y=[int(f) for f in input().split()]
    y.sort()
    d=0
    for i in y:
        d+=i
    if d<2048:
        print('No')
        continue
    if 2048 in y:
        print('yes')
        continue
    for x in range(z+1):
        if 2048 in y:
            print('yes')
            break
        for i in range(len(y)-1):
            if y[i]==y[i+1]:
                y[i+1]=y[i]*2
                y.pop(i)
            if i>len(y)-3:
                break
        y.sort()
    else:
        print('no')
n=int(input())
x=[]
for i in range(1,((n**2)//2)+1):
    x.append(n**2+1-i)
    x.append(i)
    if len(x)==n:
        print(*x)
        x=[]
for z in range(int(input())):
    z=int(input())
    x=[int(i) for i in input().split()]
    f=0
    o=0
    t=0
    for i in range(z):
        if x[i]%3==0:
            f+=1
        elif x[i]%3==1:
            o+=1
        else:
            t+=1
    if o<t:
        print(f+o+(t-o)//3)
    else:
        print(f+t+(o-t)//3)
n=int(input())
if n%2==1:
    print(0)
elif n%4==0:
    print((n//4)-1)
else:
    print(n//4)
n=[int(i) for i in input().split()]
if n[2]>=0 and n[0]>n[1]:
    print('NO')
elif n[2]<=0 and n[0]<n[1]:
    print('NO')
elif n[2]==0:
    if n[0]==n[1]:
        print('YES')
    else:
        print('NO')
elif (n[1]-n[0])%n[2]==0:
    print('YES')
else:
    print('NO')
for f in range(int(input())):
    f=[int(i) for i in input().split()]
    a=f[0]
    b=f[1]
    c=f[2]
    r=f[3]
    a,b=min(a,b),max(a,b)
    if c+r<=a or c-r>=b:
        print(b-a)
    elif c<=a:
        print(max(b-c-r,0))
    elif c>=b:
        print(max(c-a-r,0))
    else:
        v=max(b-c-r,0)
        print(v+max(c-a-r,0))
def bt(p,c):
    if c%p+c//p==0:
        return ''
    else:
        return bt(p,c//p)+str(c%p)
print(bt(int(input()),int(input())))
for t in range(int(input())):
    t=[int(i) for i in input().split()]
    n=t[0]
    m=t[1]
    x=t[2]
    y=t[3]
    d=0
    for f in range(n):
        e=input()
        c=0
        for i in range(m):
            if c==0 and i==m-1:
               if e[i]=='.':
                   d+=x
               break
            elif c==1:
                c=0
                continue
            else:
                if e[i]=='.' and e[i+1]=='.' and y<2*x:
                    c=1
                    d+=y
                elif e[i]=='.':
                    d+=x
                else:
                    continue
    print(d)
x=[int(i) for i in input().split()]
d=x[3]
x.pop(3)
x.sort()
a=x[0]
b=x[1]
c=x[2]
print(max(d-b+a,0)+max(d+b-c,0))
d=int(input())
s=input()
x=s.count('0')
y=s.count('1')
if y!=x:
    print(1)
    print(s)
else:
    print(2)
    print(s[0:-1],s[-1],sep=' ')
from random import choice
def qs(y):
    if len(y)<2:
        return y
    d=choice(y)
    s=[]
    e=[]
    l=[]
    for i in y:
        if i<d:
            s.append(i)
        elif i>d:
            l.append(i)
        else:
            e.append(i)
    return qs(l)+e+qs(s)
n=int(input())
m=int(input())
a=[]
d=0
for i in range(n):
    a.append(int(input()))
c=qs(a)
for i in range(n):
    d+=c[i]
    if d>=m:
        print(i+1)
        break'''
n=int(input())
if n%2==0:
    print((n**2)//2)
else:
    print(((n**2)//2)+1)
for f in range(n):
    c=''
    for i in range(n):
        if f%2==0:
            if i%2==0:
                c+='C'
            else:
                c+='.'
        else:
            if i%2==1:
                c+='C'
            else:
                c+='.'
    print(c)
    
