#include <bits/stdc++.h>
using namespace std;
const char black = '#';
const char white = '.';
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == black && s[i + 1] == white) {
      int left = 1, right = 1;
      int j = i + 1 + 1;
      string tmp1 = s;
      tmp1[i + 1] = black;
      int rightmost = 0;
      while (j < n && tmp1[j] == white) {
        tmp1[j] = black;
        rightmost = j;
        ++j;
        right++;
      }
      string tmp2 = s;
      tmp2[i] = white;
      j = i - 1;
      while (j >= 0 && tmp2[j] == black) {
        left++;
        tmp2[j] = white;
        --j;
      }
      if (right <= left) {
        cnt += right;
        s = tmp1;
        i = rightmost;
      } else {
        cnt += left;
        s = tmp2;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
