#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int w = 0, b = 0;
  if (S[0] == '.' && S[N - 1] == '.') {
    int j = 0;
    for (int i = 0; i < N; i++) {
      if (S[i] == '#') {
        j = i;
        break;
      }
    }
    for (; j < N; j++) {
      if (S[j] == '.')
        w++;
      else
        b++;
    }
  } else if (S[0] == '.' && S[N - 1] == '#') {
    int j = 0;
    for (int i = 0; i < N; i++) {
      if (S[i] == '#') {
        j = i;
        break;
      }
    }
    for (; j < N; j++) {
      if (S[j] == '.')
        w++;
      else
        b++;
    }
  } else if (S[0] == '#' && S[N - 1] == '.') {
    for (int i = 0; i < N; i++) {
      if (S[i] == '.')
        w++;
      else
        b++;
    }
  } else {
    for (int i = 0; i < N; i++) {
      if (S[i] == '.')
        w++;
      else
        b++;
    }
  }
  if (w <= b)
    cout << w << endl;
  else
    cout << b << endl;
}
