#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
  int h, w;
  cin >> h >> w;

  vector<vector<int>> m(h, vector<int>(w));

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      char c;
      cin >> c;
      c == '*' ? m[i][j] = 1 : m[i][j] = 0;
    }
  }
  int i = 0;
  int j = 0;
  int ans = m[0][0];
  while (i != h - 1 || j != w - 1) {
    if (i == h - 1) {
      j++;
    } else if (j == w - 1) {
      i++;
    } else if (m[i][j + 1]) {
      j++;
    } else if (m[i + 1][j]) {
      i++;
    } else {
      j++;
    }
    if (m[i][j]) ans++;
  }
  cout << ans << endl;
}