#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0, w = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.')
      w++;
    else
      b++;
  }
  for (int i = 0; i < n; i++) {
    if (s.at(n - 1 - i) == '.') {
      ans++;
    } else
      break;
  }
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      ans++;
    } else
      break;
  }
  int aa;
  if (ans == 0) {
    if (w == 0)
      aa = b;
    else if (w < b)
      aa = w;
    else
      aa = b;
  } else {
    if (w == 0) {
      if (b == 0)
        aa = ans;
      else if (ans < b)
        aa = ans;
      else
        aa = b;
    } else {
      if (b == 0) {
        if (ans < w)
          aa = ans;
        else
          aa = w;
      } else {
        if (ans <= b && ans <= w)
          aa = ans;
        else if (b <= ans && b <= w)
          aa = b;
        else
          aa = w;
      }
    }
  }
  cout << aa << endl;
}
