#include <bits/stdc++.h>

using namespace std;

char tab[10][10];

int n, m, wynik;

void bfs(int &x, int &y){
    vector<pair<int, int> > kolejka;
    kolejka.push_back({x, y});
    for (int i = 0; i < (int)kolejka.size(); i++){
        int a = kolejka[i].first, b = kolejka[i].second;
        if (b != m){
            if (tab[a][b + 1] == '*'){
                x = a;
                y = b + 1;
                return;
            }
            kolejka.push_back({a, b + 1});
        }
        if (a != n){
            if (tab[a + 1][b] == '*'){
                x = a + 1;
                y = b;
                return;
            }
            kolejka.push_back({a + 1, b});
        }
    }
    x = n;
    y = m;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cin >> tab[i][j];
    int x = 0, y = 0;
    while (x != n || y != m){
        bfs(x, y);
        //cout << x << " " << y << "\n";
        //if (wynik > 2)
        //    return 0;
        if (tab[x][y] == '*')
            wynik++;
    }
    cout << wynik << "\n";
    return 0;
}