#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int num_w = 0, num_b = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '.') num_w++;
    if (s[0] == '.')
      num_w--;
    else
      num_b++;
  }
  int ans = 0;
  if (num_w < num_b) {
    for (int i = n - 1; i >= 1; i--) {
      if (s[i] == '.' && s[i - 1] == '#') {
        s[i] = '#';
        ans++;
      }
    }
  } else {
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == '#' && s[i + 1] == '.') {
        s[i] = '.';
        ans++;
      }
    }
  }
  cout << ans << endl;
}
