#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = INF + 7;
using P = pair<long long, long long>;
signed main() {
  long long N;
  string S, T;
  cin >> N >> S;
  T = S;
  long long ans = 0, res = 0;
  long long b = 0;
  long long w = 0;
  for (long long i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ans++;
      S[i + 1] = '#';
    }
  }
  for (long long i = N - 1; i > 0; i--) {
    if (T[i] == '.' && S[i - 1] == '#') {
      res++;
      S[i - 1] = '.';
    }
  }
  cout << min(ans, res) << endl;
}
