#include <bits/stdc++.h>

using namespace std;

long long n, m, ans, curx, cury;

bool arr[6][6];

char c;

pair<long long, long long> xypair;

vector<pair<long long, long long>> forv = {{0, 1}, {1, 0}};

pair<long long, long long> bfs(long long x, long long y){
	pair<long long, long long> cur = {x, y};
	queue<pair<long long, long long>> q;

	q.push(cur);

	while(!q.empty()){
		cur = q.front();
		q.pop();

		if(arr[cur.first][cur.second]){
			return cur;
		}

		for(auto i : forv){
			if(cur.first + i.first <= n && cur.second + i.second <= m){
				q.push({cur.first + i.first, cur.second + i.second});
			}
		}
	}

	return {n, m};
}

int main(){    
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    
    cin >> n >> m;

    for(int i = 1; i <= n; i++){
    	for(int j = 1; j <= m; j++){
    		cin >> c;
    		arr[i][j] = (c == '*');
    	}
    }

    curx = 1, cury = 1;

    while(curx != n || cury != m){
    	xypair = bfs(curx, cury);
    	curx = xypair.first;
    	cury = xypair.second;
    	if(arr[curx][cury]){
    		ans++;
    		arr[curx][cury] = false;
    	}
    }

    cout << ans;
}