#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
signed main() {
  long long N;
  string S;
  cin >> N >> S;
  string S2 = S;
  long long cnt = 0;
  for (long long i = 0; i < N - 1; i++) {
    if (S.at(i) == '#' && S.at(i + 1) == '.') {
      S.at(i + 1) = '#';
      cnt++;
    }
  }
  long long cnt2 = 0;
  reverse((S2).begin(), (S2).end());
  for (long long i = 0; i < N - 1; i++) {
    if (S2.at(i) == '.' && S2.at(i + 1) == '#') {
      S2.at(i + 1) = '.';
      cnt2++;
    }
  }
  cout << min(cnt, cnt2) << endl;
  return 0;
}
