#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int solve(string stones, int start, int count) {
  if (N - 1 <= start) {
    return count;
  }
  for (int i = start; i < N - 1; i++) {
    if (stones.at(i) == '#' && stones.at(i + 1) == '.') {
      return min(solve(stones.substr(0, i) + "." +
                           stones.substr(i + 1, stones.size() - i - 1),
                       start + 1, count + 1),
                 solve(stones.substr(0, i + 1) + "#" +
                           stones.substr(i + 2, stones.size() - i - 2),
                       start + 1, count + 1));
    }
  }
  return count;
}
int main() {
  cin >> N;
  cin >> S;
  cout << solve(S, 0, 0) << endl;
}
