#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const int INT_INF = 1000000000;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  string S;
  cin >> N >> S;
  int res1 = 0, res2 = 0;
  string S2 = S;
  for (int i = 1; i < N; i++) {
    if (S[i - 1] == '#' && S[i] == '.') {
      res1++;
      S[i] = '#';
    }
  }
  for (int i = N - 2; i >= 0; i--) {
    if (S2[i + 1] == '.' && S2[i] == '#') {
      res2++;
      S2[i] = '.';
    }
  }
  int ans = min(res1, res2);
  cout << ans << endl;
  return 0;
}
