#include<bits/stdc++.h>
    using namespace std;

    int main()
    {

        long long tt=1,i,j,co=0;

        while(tt--)
        {
          long long h,w;
          cin>>h>>w;
          long long count=0;
          char a[h][w];
          for(i=0;i<h;i++)
          {
              for(j=0;j<w;j++)
              {
                  cin>>a[i][j];
              }
          }
          i=0;j=0;
         /* while(i<h-1||j<w-1)
          {
              if(a[i][j]=='*'){count++;}
              if(j+1<w&&a[i][j+1]=='*'){j++;}
              else if(i+1<h&&a[i+1][j]=='*'){i++;}
              else
              {
                  if(j<w-1){j++;}
                  else{i++;}
              }
              //cout<<i<<" "<<j<<"\n";

          }
          if(a[h-1][w-1]=='*'){count++;}
          cout<<count<<"\n";*/
int r,c;

i=0,j=0;
              while(1)
              { if(i<h-1 || j<w-1)
                 {

                  if(a[i][j]=='*')
                  {
                   co++;

                  }
                if(j+1< w && a[i][j+1]=='*')
                {
                    j++;
                }
                else if(i+1<h && a[i+1][j]=='*')
                {
                    i++;
                }

               else
              {
                  if(j<w-1){j++;}
                  else{i++;}
              }
                 }
                 else break;
                  }



              if(a[h-1][w-1]=='*'){co++;}


           printf("%lld\n",co);
        }
    }
