#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      int opt1, opt2;
      opt1 = opt2 = 0;
      int j = i;
      while (j >= 0 && s[j] == '#') {
        opt1++;
        j--;
      }
      j = i + 1;
      while (j < n && s[j] == '.') {
        opt2++;
        j++;
      }
      if (opt1 < opt2) {
        j = i;
        while (j >= 0 && s[j] == '#') {
          s[j] = '.';
          j--;
        }
      } else {
        j = i + 1;
        while (j < n && s[j] == '.') {
          s[j] = '#';
          j++;
        }
      }
      cnt += min(opt1, opt2);
    }
  }
  cout << cnt << "\n";
}
