#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, cnt1 = 0, cnt2 = 0;
  cin >> n;
  string str;
  cin >> str;
  string str2 = str;
  for (ll i = 1; i < n; i++) {
    if (str[i - 1] == '#' && str[i] == '.') {
      cnt1++;
      str[i] = '#';
    }
  }
  for (ll i = n - 1; i >= 1; i--) {
    if (str2[i] == '.' && str2[i - 1] == '#') {
      cnt2++;
      str2[i - 1] = '.';
    }
  }
  cout << min(cnt1, cnt2);
  return 0;
}
