#include <bits/stdc++.h>
using namespace std;
char S[200002];
int main(void) {
  int N;
  cin >> N;
  cin >> S;
  int cnt = 0;
  for (int i = N - 1; 0 <= i; i--) {
    if (S[i] == '#') {
      int j = 1;
      while (S[i + j] == '.' && i + j < N) {
        S[i + j] = '#';
        cnt++;
        j++;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
