#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num = 0, ans;
  string s;
  cin >> n >> s;
  int siro[n + 1], kuro[n + 1];
  siro[0] = 0;
  kuro[n] = 0;
  ans = n;
  for (int i = 0; i < n; ++i) {
    if (s[i + 1] == '#') num++;
    siro[i + 1] = num;
  }
  num = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '.') num++;
    kuro[i] = num;
  }
  for (int i = 0; i <= n; ++i) {
    if (siro[i] + kuro[i] < ans) ans = siro[i] + kuro[i];
  }
  cout << ans << endl;
}
