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
#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int EPS = 1e-6;
const int mod = 1000000007;
const long double PI = 3.14159265359;
const int dx4[4] = {0, 1, 0, -1};
const int dy4[4] = {-1, 0, 1, 0};
const int dx8[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy8[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
inline bool grid_inside(int x, int y, int n, int m) {
  return x >= 1 && x <= n && y >= 1 && y <= m;
}
template <typename T>
T lcm(T a, T b) {
  return (a * b) / __gcd(a, b);
}
template <typename T>
T Dis(T x1, T y1, T x2, T y2) {
  return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
template <typename T>
T Angle(T x1, T y1, T x2, T y2) {
  return atan((double)(y1 - y2) / (double)(x1 - x2));
}
inline int Set(int N, int pos) { return N = N | (1 << pos); }
inline int Reset(int N, int pos) { return N = N & ~(1 << pos); }
inline bool Check(int N, int pos) { return (bool)(N & (1 << pos)); }
template <class T, class X>
inline T togglebit(T a, X i) {
  T t = 1;
  return (a ^ (t << i));
}
bool compare(const pair<int, int>& i, const pair<int, int>& j) {
  return i.first < j.first;
}
int LSOne(long long int n) { return log2(n & -n) + 1; }
int rangeClear(int n, int i, int j) {
  int ones = ~0;
  int a = ones << (j + 1);
  int b = (i << 2) - 1;
  int mask = a | b;
  int ans = n & mask;
  return ans;
}
long long int mul_mod(long long int x, long long int y, long long int mod) {
  long long int i = 0, j = x;
  while (y > 0) {
    if (y & 1) {
      i = (i + j) % mod;
    }
    j = (j + j) % mod;
    y >>= 1;
  }
  return i;
}
long long int fast_power(int a, int x) {
  if (x == 0)
    return 1;
  else if (x == 1)
    return a;
  else {
    long long int R = fast_power(a, x >> 1);
    if (!(x & 1))
      return R * R;
    else
      return R * a * R;
  }
}
long long int fast_power_unlocked(long long int a, long long int n,
                                  long long int mod) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) {
      res = mul_mod(res, a, mod);
    }
    a = mul_mod(a, a, mod);
    n = n >> 1;
  }
  return res;
}
long long int modInverse(long long int A, long long int M) {
  return fast_power_unlocked(A, M - 2, M);
}
const int maxn = 1e7 + 5;
void solve() {
  long long int n;
  cin >> n;
  if (n & 1) {
    cout << ((((n + 1) / 2) * ((n + 1) / 2)) + ((n / 2) * (n / 2))) << '\n';
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (!(i & 1)) {
          if (!(j & 1))
            cout << 'C';
          else
            cout << '.';
        } else {
          if (j & 1)
            cout << "C";
          else
            cout << ".";
        }
      }
      cout << '\n';
    }
  } else {
    cout << (n * ((n + 1) / 2)) << '\n';
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i & 1) {
          if (j & 1) {
            cout << 'C';
          } else
            cout << '.';
        } else {
          if (j & 1)
            cout << '.';
          else
            cout << 'C';
        }
      }
      cout << '\n';
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ;
  for (auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);
       blockTime.second;
       fprintf(stderr, "%s: %ld ms\n", "Time Taken",
               chrono::duration_cast<chrono::milliseconds>(
                   chrono::high_resolution_clock::now() - blockTime.first)
                   .count()),
            fflush(stderr), blockTime.second = false) {
    solve();
  }
}
