#include <bits/stdc++.h>
using namespace std;
const int inf = 2147483647, dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
const int N = 100005, M = 1000005, mod = 1000000007;
const long long llinf = 9223372036854775807ll;
int n, ans, sum;
bool ok;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '#') ok = true;
  if (!ok) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '.') sum++;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.')
      ans++;
    else
      break;
  }
  cout << sum - ans;
  return 0;
}
