#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, m; cin >> n >> m;
    string red[n];
    char zid = '*'; 
    char slobodno = '.';
    int brzid=0;
    int brslobodno=0;
    for(int i=0; i<n; i++){
        cin >> red[i];
        
    }
    for(int i=0; i<n; i++)
        for (char c : red[i]) {
            if (c == zid) {
                brzid++;
        }
    }
    cout << n*m-brzid;

    return 0;
}