#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool turn = 0;
  int black = 0;
  int left = 0, right = n - 1;
  int cnt = 0;
  while (right - left > 0) {
    if (s[left] == '.' && s[right] == '#') {
      left++;
      right--;
    }
    if (s[left] == '#' && s[right] == '#') right--;
    if (s[left] == '.' && s[right] == '.') left++;
    if (s[left] == '#' && s[right] == '.') {
      cnt++;
      left++;
      right--;
    }
  }
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '#') black++;
  }
  int ans = min(cnt, min(black, n - black));
  cout << ans << endl;
}
