#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 2147483647;
const ll MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int white = 0;
  int black = 0;
  for (int i = 0; i < int(s.size()); ++i) {
    if (s[i] == '.') white++;
    if (s[i] == '#') black++;
  }
  bool flag = false;
  int cnt = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (!flag && s[i] == '.') flag = true;
    if (flag && s[i] == '#') cnt++;
  }
  int nin = min(black, white);
  nin = min(nin, cnt);
  cout << nin << endl;
  return 0;
}
