#include <bits/stdc++.h>
using namespace std;
static const int giga = pow(10, 9);
int n;
string input;
bool judge(int);
int main(void) {
  cin >> n >> input;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (input[i - 1] == '#' && input[i] == '.') {
      int left = 0;
      int right = 0;
      do {
        left++;
        if (input[i + 1] == '.') {
          right++;
        } else {
          break;
        }
      } while (input[i - left] == '#' || input[i + right] == '.' || left == i ||
               right == n - 1 - i);
      ans += min(right, left);
    }
  }
  cout << ans << endl;
  return 0;
}
