//Author Alphabet_13
//C++
#include <bits/stdc++.h>
using namespace std;
char a[10][10];
int ans, n, m;
void dfs(int x, int y) {
    ans += (a[x][y] == '*');
    if(x == n - 1 && y == m - 1) {
        cout << ans << "\n";
        exit(0);
    }
    if(x + 1 < n && a[x + 1][y] == '*') dfs(x + 1, y);
    if(y + 1 < m && a[x][y + 1] == '*') dfs(x, y + 1);
    if(y + 1 < m) dfs(x, y + 1);
    if(x + 1 < n) dfs(x + 1, y);
    return;
}
int main() {
    cin >> n >> m;
    int cnt = 0, mx = 0;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < m; j++)
            cin >> a[i][j];
    dfs(0, 0);
    cout << "gg\n";
    return 0;
}