#pragma GCC optimize("O3")
//#pragma GCC target("avx")
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <iomanip>
#include <list>
using namespace std;
#define re return
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define make_unique(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define fi first
#define se second
#define ss second.second
#define sf second.first
#define ff first.first
#define fs first.second
#define sqrt(x) sqrt(abs(x))
#define mp make_pair
#define PI 3.14159265358979323846
#define E 2.71828182845904523536
#define er erase
#define in insert
#define fo(i,n) for((i)=0;(i)<(n);(i)++)
#define ro(i,n) for((i)=n-1;(i)>=0;(i)--)
#define fr(i,j,n) for((i)=(j);(i)<(n);(i)++)
#define rf(i,j,n) for((i)=((n)-1);(i)>=(j);(i)--)
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
void eras(map<int,int> &m,int x)
{
    m[x]--;
    if (!m[x]) m.erase(x);
}
const int N=(int)1e5+100;
const int M=(int)2e6+100;
const int inf=(int)1e8;
const double eps=1e-9;
#define filename ""
    string s[10];
int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen(filename".in","r",stdin);
    //freopen(filename".out","w",stdout);
    //freopen("ans.txt","w",stdout);
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    srand(time(0));
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,m,i,j;
    cin>>n>>m;
    fo(i,n)
    {
        cin>>s[i];
    }
    int x=0;
    int y=0;
    int ans=(s[0][0]=='*');
    while(x!=n-1||y!=m-1)
    {
        if (y!=m-1)
        {
            int r=100;
            for(int i=y+1;i<m;i++)
            {
                if (s[x][i]=='*')
                {
                    r=i-y;
                    break;
                }
            }
            if (x!=n-1)
            {
                int l=100;
                for(int i=x+1;i<n;i++)
                {
                    if (s[i][y]=='*')
                    {
                        l=i-x;
                        break;
                    }
                }
                if (r<=l)
                {
                    y++;
                }
                else
                {
                    x++;
                }
            }
            else
            {
                y++;
            }
        }
        else
        {
            x++;
        }
        ans+=(s[x][y]=='*');
    }
    cout<<ans;
}
