#include <bits/stdc++.h>
const double eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e4 + 5;
using namespace std;
int main() {
  int n;
  cin >> n;
  cin.get();
  string s;
  cin >> s;
  int pos = -1;
  for (int i = 0; i <= (n - 1); i++) {
    if (s[i] == '#') {
      pos = i;
      break;
    }
  }
  if (pos == -1) return 0 * puts("0");
  int cnt1 = 0, cnt2 = 0;
  for (int i = pos; i <= (n - 1); i++) {
    if (s[i] == '#')
      cnt1++;
    else
      cnt2++;
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
