#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;
  int i = N - 1;
  while (cp[i] == '#' && i >= 0) {
    z++;
    i--;
  }
  for (int i = 0; i < N - z; i++) {
    if (cp[i] == '#')
      B++;
    else
      y++;
  }
  i = 0;
  z = 0;
  while (cp[i] == '.' && i < N) {
    z++;
    i++;
  }
  for (int i = z; i < N; i++) {
    if (cp[i] == '.') A++;
  }
  A = min(A, B);
  cout << min(x, A);
  return 0;
}
