#include <bits/stdc++.h>
const int INF = 1001001001;
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int res = 0;
  int rl = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      rl++;
    else {
      res += rl;
      rl = 0;
    }
  }
  int res2 = 0;
  rl = 0;
  reverse(s.begin(), s.end());
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      rl++;
    else {
      res2 += rl;
      rl = 0;
    }
  }
  res = min(res, res2);
  cout << res << endl;
}
