Lunar New Year is approaching, and you bought a matrix with lots of "crosses".

This matrix M of size n × n contains only 'X' and '.' (without quotes). The element in the i-th row and the j-th column (i, j) is defined as M(i, j), where 1 ≤ i, j ≤ n. We define a cross appearing in the i-th row and the j-th column (1 < i, j < n) if and only if M(i, j) = M(i - 1, j - 1) = M(i - 1, j + 1) = M(i + 1, j - 1) = M(i + 1, j + 1) =  'X'.

The following figure illustrates a cross appearing at position (2, 2) in a 3 × 3 matrix.
    
    
      
    X.X  
    .X.  
    X.X  
    

Your task is to find out the number of crosses in the given matrix M. Two crosses are different if and only if they appear in different rows or columns.

Input

The first line contains only one positive integer n (1 ≤ n ≤ 500), denoting the size of the matrix M.

The following n lines illustrate the matrix M. Each line contains exactly n characters, each of them is 'X' or '.'. The j-th element in the i-th line represents M(i, j), where 1 ≤ i, j ≤ n.

Output

Output a single line containing only one integer number k — the number of crosses in the given matrix M.

Examples

Input


5
.....
.XXX.
.XXX.
.XXX.
.....


Output


1


Input


2
XX
XX


Output


0


Input


6
......
X.X.X.
.X.X.X
X.X.X.
.X.X.X
......


Output


4

Note

In the first sample, a cross appears at (3, 3), so the answer is 1.

In the second sample, no crosses appear since n < 3, so the answer is 0.

In the third sample, crosses appear at (3, 2), (3, 4), (4, 3), (4, 5), so the answer is 4.
import java.util.*;
import java.io.*;



public class Main {
    static OutputWriter out;

    public static void main(String[] args)
    {
        InputReader in = new InputReader(System.in);
        out = new OutputWriter(System.out);
        int n = in.nextInt();
        char[][]c = new char[n][n];
        for (int i =0;i<n;i++)
        {
            String s = in.readString();
            for (int j =0;j<n;j++)
            {
                c[i][j]=s.charAt(j);
            }
        }
        int ans =0;
        for (int i =1;i<n-1;i++)
        {
            for (int j=1;j<n-1;j++)
            {
                if (c[i][j]==c[i-1][j+1]&&c[i][j]==c[i+1][j-1]&&c[i][j]==c[i+1][j+1]&&c[i][j]==c[i-1][j-1]&&c[i][j]=='X')
                    ans++;
            }
        }
        out.printLine(ans);
       out.flush();
    }

}
class MyScanner {

    StringTokenizer st;
    BufferedReader br;

    public MyScanner(InputStream s) {
        br = new BufferedReader(new InputStreamReader(s));
    }

    public MyScanner (FileReader f) {
        br = new BufferedReader(f);
    }

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

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

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

    public String nextLine() throws IOException {
        return br.readLine();
    }

    public double nextDouble() throws IOException {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
        double res = 0, f = 1;
        boolean dec = false, neg = false;
        int start = 0;
        if (x.charAt(0) == '-') {
            neg = true;
            start++;
        }
        for (int i = start; i < x.length(); i++)
            if (x.charAt(i) == '.') {
                res = Long.parseLong(sb.toString());
                sb = new StringBuilder("0");
                dec = true;
            } else {
                sb.append(x.charAt(i));
                if (dec)
                    f *= 10;
            }
        res += Long.parseLong(sb.toString()) / f;
        return res * (neg ? -1 : 1);
    }

    public boolean ready() throws IOException {
        return br.ready();
    }

    public boolean nextEmpty() throws IOException {
        String s = nextLine();
        st = new StringTokenizer(s);
        return s.isEmpty();
    }
}


class pair  implements Comparable
{
    long dist;
    long to;
    public pair(long to, long dist)
    {
        this.dist = dist;
        this.to = to;
    }
    @Override
    public int compareTo(Object o) {
        pair temp =(pair)o;
        return Long.compare(dist+to,temp.dist+temp.to);
    }
}
class Graph {


    int n;
    ArrayList<Integer>[] adjList;

    public Graph(int n) {
        this.n = n;
        adjList = new ArrayList[n];
        for (int i = 0; i < n; i++)
            adjList[i] = new ArrayList<>();
    }

}



class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }


    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}
