#include <bits/stdc++.h>
using namespace std;
const int nn = 2e5 + 5;
int hitam[nn], putih[nn];
int main() {
  int ans = 1e9, n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      hitam[i] = 1;
    else
      putih[i] = 1;
    if (i > 0) hitam[i] += hitam[i - 1];
    if (i > 0) putih[i] += putih[i - 1];
  }
  for (int i = 0; i < n; i++) {
    ans = min(ans, hitam[i] + putih[n - 1] - putih[i]);
  }
  cout << ans << endl;
}
