#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  int n;
  string s;
  int ans = 0;
  cin >> n >> s;
  int break_point = 0;
  int black = 0;
  int white = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] != '.') {
      break_point = i;
      break;
    }
  }
  for (int i = break_point; i < n; i++) {
    if (s[i] == '.' && i != break_point) {
      white++;
    } else if (s[i] == '#' && i != n - 1) {
      black++;
    }
  }
  ans = min(white, black);
  s[break_point] = '.';
  for (int i = 0; i < (n); i++) {
    if (s[i] != '.') {
      break_point = i;
      break;
    }
  }
  white = 0, black = 0;
  for (int i = break_point; i < n; i++) {
    if (s[i] == '.' && i != break_point) {
      white++;
    } else if (s[i] == '#' && i != n - 1) {
      black++;
    }
  }
  cout << min(ans, min(white, black) + 1) << endl;
}
