/**
 *  author: souravrax
 *  created: 01.04.2021 20:38:11
**/
#include <bits/stdc++.h>
using namespace std;

#define all(x) begin(x), end(x)
#define len(x) int((x).size())
#define fast ios::sync_with_stdio(false), cin.tie(nullptr)
#define log(...) cerr << #__VA_ARGS__ << ": " << __VA_ARGS__ << '\n';
using ll = long long;


int solve(vector<string>& matrix, int n, int m) {

    auto dist = [&](int x, int y, int a, int b) {
        return (x - a) * (x - a) + (y - b) * (y - b);
    };

    int x = 0, y = 0;
    int ans = matrix[0][0] == '*';
    while (x < n || y < m) {
        vector<tuple<int, int, int>> now;
        for (int i = x; i < n; i++) {
            for (int j = y; j < m; j++) {
                if (i == x && y == j) continue;
                if (matrix[i][j] == '*') {
// cout << i << ' ' << j << ' ' << dist(x, y, i, j) << endl;
                    now.emplace_back(dist(x, y, i, j), i, j);
                }
            }
        }
        if (now.empty()) break;
        sort(now.begin(), now.end());
        auto [w, nx, ny] = now[0];
        ans++;
        x = nx, y = ny;
// log(w);
// log(x);
// log(y);
    }
    return ans;
}

int32_t main() {
    fast;
    int n, m;
    cin >> n >> m;
    vector<string> matrix(n);
    for (int i = 0; i < n; i++) {
        cin >> matrix[i];
    }
    int res = solve(matrix, n, m);
    cout << res << endl;
}

