#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int i = 0;
  int ans = 0;
  int m = n;
  for (int i = m - 1; i >= 0; --i)
    if (s[i] == '#')
      n--;
    else
      break;
  while (i < n && s[i] != '#') ++i;
  int cntb = 0, cntw = 0;
  while (i < n) {
    if (s[i] == '#')
      cntb++;
    else
      cntw++;
    ++i;
  }
  ans += min(cntb, cntw);
  cout << ans << endl;
  return 0;
}
