#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct edge {
  int to, cost;
};
const int INF = 1e9;
const double EPS = 1e-10;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const int mx4[] = {0, 1, 0, -1};
const int my4[] = {1, 0, -1, 0};
const int mx8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int my8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int flag = 0, cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      flag = 1;
    }
    if (flag && s[i] == '.') cnt++;
  }
  if (!flag)
    cout << 0 << "\n";
  else
    cout << cnt << "\n";
  return 0;
}
