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