#include <bits/stdc++.h>
using ll = unsigned long long;
using namespace std;
int gcd(int x, int y) {
  if (y == 0) {
    return x;
  } else {
    return gcd(y, x % y);
  }
}
int lcm(int x, int y) { return x / gcd(x, y) * y; }
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> vec1(n);
  vector<int> vec2(n);
  if (s[0] == '#') {
    vec1[0] = 1;
  }
  if (s[n - 1] == '.') {
    vec2[n - 1] = 1;
  }
  for (int i = 1; i < n; i++) {
    vec1[i] = vec1[i - 1];
    if (s[i] == '#') {
      vec1[i]++;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    vec2[i] = vec2[i + 1];
    if (s[i] == '.') {
      vec2[i]++;
    }
  }
  int Min = vec1[n - 1];
  Min = min(vec2[0], Min);
  for (int i = 1; i < n - 1; i++) {
    Min = min({Min, vec1[i] + vec2[i + 1]});
  }
  cout << Min << endl;
}
