#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 x = 0, y = 0;
  int mi = 0;
  int i = 0;
  int f = 0;
  while (s[i] == '.' && i < n) {
    mi = i;
    i++;
    f++;
  }
  if (i == n) {
    cout << "0" << endl;
    return 0;
  }
  for (i = mi; i < n; i++) {
    if (s[i] == '#') {
      x++;
    } else {
      y++;
    }
  }
  if (x < y + f) {
    cout << x << endl;
  } else {
    cout << y + f << endl;
  }
}
