#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  string S;
  cin >> N >> S;
  int blacknumber = 0, whitenumber = 0;
  for (int(i) = 0; (i) < (N); (i)++) {
    if (S[i] == '#') {
      blacknumber++;
    } else {
      whitenumber++;
    }
  }
  int ans = 0;
  for (int(i) = 0; (i) < (N - 1); (i)++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      S[i + 1] = '#';
      ans++;
    }
  }
  ans = min(ans, blacknumber);
  ans = min(ans, whitenumber);
  cout << ans;
  return 0;
}
