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