#include <bits/stdc++.h>  
using namespace std;
 
#define int long long
#define double long double
#define pii pair<int,int>
#define vi vector<int>
#define uii unordered_map<int,int>
#define pqmax priority_queue<int>
#define pqmin priority_queue<int, vector<int>, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define fo(i,n) for(int i = 0; i < n; i++)
#define nl "\n"
#define mp make_pair
#define pb push_back
#define mk(a,n,type) type *a = new type[n]
#define fi first
#define se second
#define INF 2e18
#define mod 1000000007
#define pi 3.14159265358979323846
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
int gcd(int a, int b){if(!b)return a;return gcd(b, a % b);} 
int power(int x,int y,int p =mod ){int res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int lcm(int a , int b){return (a*b)/gcd(a,b);}



int solve(vector<string> &s, int n, int m, int i, int j){
    if(i==n || j==m){
        return 0;
    }



    int cur = 0;
    if(s[i][j] == '*'){
        cur++;
    }
    
    int op1 = cur + solve(s, n, m, i+1, j);
    int op2 = cur +  solve(s, n, m, i, j+1);

    return max(op1, op2);
}

int32_t main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
srand(chrono::high_resolution_clock::now().time_since_epoch().count());

int t = 1;
// cin >> t;

    while (t--) {
        int n,m;
        cin>>n>>m;
        vector<string> s;
        for(int i=0; i<n; i++){
            string x;
            cin>>x;
            s.pb(x);
        }

        int xs =0, ys =0, ans=0;
        if(s[0][0] == '*'){
            ans++;
        }
        while(1){
            vector<pair<int, pair<int,int> >> tem;
            for(int i= xs; i<n; i++){
                for(int j=ys; j<n; j++){
                    if(i==xs && j==ys) continue;
                    if(s[i][j]=='*'){
                        int x = i - xs;
                        int y = j - ys;
                        int d = x+y;
                        tem.pb(mp(d, mp(i,j)));
                    }
                }
            }

            if(tem.empty()){
                break;
            }
            ans++;
            sort(all(tem));
            xs =  tem[0].second.first;
            ys =  tem[0].second.second;
        }
        cout<<ans<<"\n";
    }

 return 0;
}