#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int main() {
  cin >> N;
  cin >> S;
  char left = S[0];
  int num = 0;
  for (int i = 1; i < N; i++) {
    char right = S[i];
    if ((left == '#') && (right == '.')) {
      int num1 = 1;
      int num2 = 1;
      int j = i - 2;
      int k = i + 1;
      while ((j >= 0)) {
        if (S[j] == '#') {
          num1 += 1;
          j -= 1;
        } else {
          break;
        }
      }
      while ((k < N)) {
        if (S[k] == '.') {
          num2 += 1;
          k += 1;
        } else {
          break;
        }
      }
      num += min(num1, num2);
    }
    left = S[i];
  }
  cout << num << endl;
  return 0;
}
