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