#include <bits/stdc++.h>
using namespace std;
int cost[2][100001];
int main() {
  int n;
  string s;
  cin >> n >> s;
  int c = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      ++c;
    }
    cost[0][i] = c;
  }
  if (c == 0) {
    cout << 0 << endl;
    return 0;
  }
  c = 0;
  for (int i = n - 1; 0 <= i; --i) {
    if (s[i] == '.') {
      ++c;
    }
    cost[1][i] = c;
  }
  if (c == 0) {
    cout << 0 << endl;
    return 0;
  }
  int min = n;
  for (int i = 0; (i + 1) < n; ++i) {
    if ((cost[0][i] + cost[1][i + 1]) < min) {
      min = (cost[0][i] + cost[1][i + 1]);
    }
    if ((cost[0][i + 1] + cost[1][i]) < min) {
      min = (cost[0][i + 1] + cost[1][i]);
    }
  }
  cout << min << endl;
}
