#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1000000007;
int ans;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int x = 0, y = n - 1;
  while (x < n && s[x] == '.') x++;
  while (y >= 0 && s[y] == '#') y--;
  int w = 0, b = 0;
  for (int i = x; i <= y; i++) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  cout << min(b, w) << endl;
  return 0;
}
