#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = 1050000000;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0;
  while (s[i] == '#') {
    i++;
  }
  int last = i;
  int x = 0, y = 0;
  for (i = last; i < n; i++) {
    if (s[i] == '#') {
      x++;
    } else {
      y++;
    }
  }
  cout << min(x + last, y) << endl;
}
