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.

Input

The first line contains an integer n (1 ≤ n ≤ 1000).

Output

On the first line print an integer, the maximum number of Coders that can be placed on the chessboard.

On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'.

If there are multiple correct answers, you can print any.

Examples

Input

2


Output

2
C.
.C

import java.io.*;
import java.util.*;

public class Main {
    
    public static boolean isPrime(int a){
        if(a==1) return false;
        if(a == 2)return true;
        if(a %2==0) return false;
        for(int i=3;i*i<=a;i += 2)
            if(a%i == 0)
                return false;
        return true;
    }
       
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        //Map<String,String> map = new TreeMap<String,String>();
        new A().run();
        br.close();
        pw.close();
        
    }//end main
    
    public static StringTokenizer st;
    public static BufferedReader br;
    public static PrintWriter pw;
   
   

    public static String nextToken() throws IOException {
        while ( st == null || !st.hasMoreTokens() ) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }//end nextToken
    
    static class Uva11455{
        public void run() throws IOException{
            long n;
            int a[] = new int[4];
            n = Integer.parseInt(nextToken());
            while(n-- != 0){
                a[0] = Integer.parseInt(nextToken());
                a[1] = Integer.parseInt(nextToken());
                a[3] = Integer.parseInt(nextToken());
                a[3] = Integer.parseInt(nextToken());
                
                Arrays.sort(a);
                if(a[0]==a[1] && a[1]==a[2] && a[2]==a[3])
                    pw.write("square\n");
                else if(a[0]!=a[2] && a[1]!=a[3] && a[0]==a[1] && a[2]==a[3])
                    pw.write("rectangle\n");
                //else if()
            }//end while
        }//end run
    }//end class Uva11455
    
    static class Uva11827{
        
    }//end Uva11827
    
    static class A{
        public void run() throws IOException{
            int n = Integer.parseInt(nextToken());
            int a,b;
            String s,ss;
            s =ss="";
            
            if(n%2==1){
                a = n/2+1;
                b = a-1;
                for(int i=0;i<b;i++){
                    s += "C.";
                    ss += ".C";
                }
                s += "C";ss+=".";
            }else{
                a=b= n/2;
                for(int i=0;i<a;i++){
                    s += "C.";
                    ss += ".C";
                }
            }
            
            long res = a*a+b*b;
            pw.write(res+"\n");
            for(int i=0;i<n;i++){
                if(i%2==0) pw.write(s+"\n");
                else pw.write(ss+"\n");
            }//end for
            pw.flush();
        }//end run
    }//end class A
    
}//end class Main
