#include <bits/stdc++.h>
using namespace std;
int A, B, C, D, N, M;
string in;
int main() {
  ios::sync_with_stdio(false);
  cin >> N;
  cin >> in;
  string cp = in;
  int x = 0;
  int y = 0;
  for (int i = 0; i < N; i++) {
    if (in[i] == '#') {
      x++;
    } else
      y++;
  }
  x = min(x, y);
  int z = 0;
  for (int i = N - 1; i > 0; i--) {
    if (cp[i] == '#')
      z++;
    else
      break;
  }
  for (int i = 0; i < N - z; i++) {
    if (cp[i] == '#') M++;
  }
  cout << min(x, M);
  return 0;
}
