#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string S;
  cin >> S;
  string T = S;
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    if (S[i - 1] == '#' && S[i] == '.') {
      S[i] = '#';
      ans++;
    }
  }
  int ans2 = 0;
  reverse((T).begin(), (T).end());
  for (int i = 1; i < n; ++i) {
    if (T[i - 1] == '.' && T[i] == '#') {
      T[i] = '.';
      ans2++;
    }
  }
  ans = min(ans, ans2);
  cout << (ans) << endl;
  return 0;
}
