#include <bits/stdc++.h>
using namespace std;
void solve(long long N, std::string S) {
  string copy = S;
  int ans = 400000;
  int cnt = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      cnt++;
      S[i + 1] = '#';
    }
  }
  ans = min(ans, cnt);
  cnt = 0;
  for (int i = N - 1; i > 0; i--) {
    if (copy[i] == '.' && copy[i - 1] == '#') {
      cnt++;
      copy[i - 1] = '.';
    }
  }
  ans = min(ans, cnt);
  cout << ans << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
