#include <bits/stdc++.h>
using namespace std;
constexpr long long int linf = numeric_limits<long long int>::max() - 5;
constexpr int inf = numeric_limits<int>::max() - 5;
constexpr long long int mod = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  int resulta = 0, resultb = 0;
  for (int i = (1); (i) < (n); (i)++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      resulta++;
    }
  }
  for (int i = (n)-1; (i) >= (1); (i)--) {
    if (t[i] == '.' && t[i - 1] == '#') {
      t[i - 1] = '.';
      resultb++;
    }
  }
  cout << min(resulta, resultb) << endl;
  return 0;
}
