from collections import Counter n, m = map(int, input().split()) s = [input() for _ in range(n)] f = [0] * m for si in s: for j, c in enumerate(si): if c == 'o': f[j] += 1 ans = 0 for si in s: ans += all(c == 'x' or f[j] == 1 for j, c in enumerate(si)) and si.count('o') >= 1 print(ans)