You are given a rectangular cake, represented as an r × c grid. Each cell either has an evil strawberry, or is empty. For example, a 3 × 4 cake may look as follows:

<image>

The cakeminator is going to eat the cake! Each time he eats, he chooses a row or a column that does not contain any evil strawberries and contains at least one cake cell that has not been eaten before, and eats all the cake cells there. He may decide to eat any number of times.

Please output the maximum number of cake cells that the cakeminator can eat.

Input

The first line contains two integers r and c (2 ≤ r, c ≤ 10), denoting the number of rows and the number of columns of the cake. The next r lines each contains c characters — the j-th character of the i-th line denotes the content of the cell at row i and column j, and is either one of these: 

  * '.' character denotes a cake cell with no evil strawberry; 
  * 'S' character denotes a cake cell with an evil strawberry. 

Output

Output the maximum number of cake cells that the cakeminator can eat.

Examples

Input

3 4
S...
....
..S.


Output

8

Note

For the first example, one possible way to eat the maximum number of cake cells is as follows (perform 3 eats).

<image> <image> <image>
    import java.io.*;
    import java.util.*;
    public class Codechef{

        static class Reader 
        { 
            final private int BUFFER_SIZE = 1 << 16; 
            private DataInputStream din; 
            private byte[] buffer; 
            private int bufferPointer, bytesRead; 

            public Reader() 
            { 
                din = new DataInputStream(System.in); 
                buffer = new byte[BUFFER_SIZE]; 
                bufferPointer = bytesRead = 0; 
            } 

            public Reader(String file_name) throws IOException 
            { 
                din = new DataInputStream(new FileInputStream(file_name)); 
                buffer = new byte[BUFFER_SIZE]; 
                bufferPointer = bytesRead = 0; 
            } 

            public String readLine() throws IOException 
            { 
                byte[] buf = new byte[1000]; // line length 
                int cnt = 0, c; 
                while ((c = read()) != -1) 
                { 
                    if (c == '\n') 
                        break; 
                    buf[cnt++] = (byte) c; 
                } 
                return new String(buf, 0, cnt); 
            } 

            public int nextInt() throws IOException 
            { 
                int ret = 0; 
                byte c = read(); 
                while (c <= ' ') 
                    c = read(); 
                boolean neg = (c == '-'); 
                if (neg) 
                    c = read(); 
                do
                { 
                    ret = ret * 10 + c - '0'; 
                } while ((c = read()) >= '0' && c <= '9'); 

                if (neg) 
                    return -ret; 
                return ret; 
            } 

            public long nextLong() throws IOException 
            { 
                long ret = 0; 
                byte c = read(); 
                while (c <= ' ') 
                    c = read(); 
                boolean neg = (c == '-'); 
                if (neg) 
                    c = read(); 
                do { 
                    ret = ret * 10 + c - '0'; 
                } 
                while ((c = read()) >= '0' && c <= '9'); 
                if (neg) 
                    return -ret; 
                return ret; 
            } 

            public double nextDouble() throws IOException 
            { 
                double ret = 0, div = 1; 
                byte c = read(); 
                while (c <= ' ') 
                    c = read(); 
                boolean neg = (c == '-'); 
                if (neg) 
                    c = read(); 

                do { 
                    ret = ret * 10 + c - '0'; 
                } 
                while ((c = read()) >= '0' && c <= '9'); 

                if (c == '.') 
                { 
                    while ((c = read()) >= '0' && c <= '9') 
                    { 
                        ret += (c - '0') / (div *= 10); 
                    } 
                } 

                if (neg) 
                    return -ret; 
                return ret; 
            } 

            private void fillBuffer() throws IOException 
            { 
                bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
                if (bytesRead == -1) 
                    buffer[0] = -1; 
            } 

            private byte read() throws IOException 
            { 
                if (bufferPointer == bytesRead) 
                    fillBuffer(); 
                return buffer[bufferPointer++]; 
            } 

            public void close() throws IOException 
            { 
                if (din == null) 
                    return; 
                din.close(); 
            } 
        }
        public static void main(String[] args){
        ///Comment this code while running in Online Judge
            try {
                // System.out.println(System.getProperty("ONLINE_JUDGE"));
                if (System.getProperty("ONLINE_JUDGE") == null) {
                    FileOutputStream output=new FileOutputStream("output.txt");
                    PrintStream out=new PrintStream(output);
                    System.setOut(out);
                    
                    InputStream input=new FileInputStream("input.txt");
                    System.setIn(input); 
                }
                
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }

            try{
                Reader s=new Reader(); 
                int r = s.nextInt();
                int c = s.nextInt();

                int i = 1;
                int j = 1;
                int[] rs = new int[r+1];
                int[] cs = new int[c+1];
                // System.out.println(r+" "+c);
                int[][] path = new int[r+1][c+1];
                while(i<=r){
                    String st = s.readLine().trim();
                    while(st.length() == 0)
                     st = s.readLine().trim();
                    // System.out.println(st);
                    for(j=0;j<c;j++){
                    if(st.charAt(j) == 'S')
                    {
                                // System.out.println(i +" S "+(j+1));
                                path[i][j+1] = 2;
                        rs[i] = 1;
                        cs[j+1] = 1;
                    }
                }
                    i++;
                }
                int res = 0;
        
                // int res = 0;
                for(i=1;i<path.length;i++){
                    if(rs[i] == 1)
                     continue;
                    for(j=1;j<path[0].length;j++){
                     if(path[i][j] < 1)
                     {
                         res++;
                         path[i][j] = 11;
                     }
                    }
                }

         
                for(i=1;i<path[0].length;i++){
           if(cs[i] == 1)
                        continue;
                     for(j=1;j<path.length;j++){
                        
                     if(path[j][i] < 1)
                     {
                         res++;
                         path[j][i] = 1;
                     }
                    }
                }
                // for(i=1;i<path.length;i++){
                //     for(j=1;j<path[0].length;j++){
                //   System.out.println(i+" "+j+" "+path[i][j]);
                //     }
                // }
                // System.out.println(p +" "+q);
                // if(p==0 && q==0)
                // res = res/2;
                System.out.println(res);
               
            }
            catch(Exception e){
            
                System.out.println(e);
                    return;
                }

            
        }
    }
