#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cont = 0, temp1, temp2;
  for (int i = 1; i < n; ++i) {
    if (s[i] == '.' && s[i - 1] == '#') {
      temp1 = temp2 = 0;
      for (int j = i; s[j] == '.' && j < n; ++j) {
        temp1++;
      }
      for (int j = i - 1; s[j] == '#' && j >= 0; --j) {
        temp2++;
      }
      cont += min(temp1, temp2);
      if (temp1 < temp2) {
        for (int j = 0; s[i] == '.' && j < n; ++j) {
          s[j] = '#';
        }
      } else {
        for (int j = i - 1; s[j] == '#' && j >= 0; --j) {
          s[j] = '.';
        }
      }
    }
  }
  cout << cont << "\n";
  return 0;
}
