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.util.*;
import java.io.*;

public class AA implements Runnable {
		
	public void solve() throws IOException {
		int N = nextInt();
                char[][] ans = new char[N][N];
                for(int i = 0; i < N; i++) Arrays.fill(ans[i], '.');
                
                int cnt = 0;
                int[] dx = {1, -1, 0, 0};
                int[] dy = {0, 0, 1, -1};
                for(int i = 0; i < N; i++){
                        for(int j = 0; j < N; j++){
                                boolean ok = true;
                                for(int k = 0 ; k < 4; k++){
                                        int nx = i + dx[k];
                                        int ny = j + dy[k];
                                        if(nx >= 0 && nx < N && ny >= 0 && ny < N){
                                                if(ans[nx][ny] != '.') ok = false;
                                        }
                                }
                                if(ok){ ans[i][j] = 'C'; cnt++;}
                        }
                }
                
                StringBuilder sb = new StringBuilder();
                for(int i = 0; i < N; i++){
                        for(int j = 0; j < N; j++){
                                sb.append(ans[i][j]);
                        }
                        sb.append("\n");
                }
                
                System.out.println(cnt);
                System.out.print(sb.toString());
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------------------------------------------------
	public static void main(String[] args) {
		new AA().run();
	}

        public void print1Int(int[] a){
                for(int i = 0; i < a.length; i++)
                        System.out.print(a[i] + " ");
                System.out.println();
        }
        
        public void print2Int(int[][] a){
                for(int i = 0; i < a.length; i++){
                        for(int j = 0; j < a[0].length; j++){
                                System.out.print(a[i][j] + " ");
                        }
                        System.out.println();
                }
        }
        
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tok = null;
			solve();
			in.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	BufferedReader in;
	StringTokenizer tok;
}