#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x.size())
using namespace std;
using ll = long long;
using vi = vector<int>;

int H, W;
bool grid[5][5];

void solve() {
    cin >> H >> W;
    string s;
    rep(i, 0, H) {
        cin >> s;
        rep(j, 0, W) {
            grid[i][j] = s[j] == '*';
        }
    }
    int ci = 0, cj = 0, ans = 0;
    while (ci != H-1 || cj != W-1) {
        // Choose by closest first, ties broken by rightmost
        int ni = H-1, nj = W-1;
        rep(i, ci, H) {
            rep(j, cj, W) {
                if (grid[i][j]) {
                    int nd = i-ci + j-cj;
                    if (nd < ni-ci + nj-cj) {
                        ni = i;
                        nj = j;
                    }
                }
            }
        }
        if (grid[ni][nj]) {
            ans++;
            grid[ni][nj] = false;
        }
        ci = ni, cj = nj;
    }
    cout << ans << endl;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}