#include <bits/stdc++.h>
using namespace std;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
const int INF = 1 << 29;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int cnt = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      int ts = 0;
      int td = 0;
      for (int j = i - 1; j >= 0; j--) {
        if (S[j] == '#') {
          ts++;
        } else {
          break;
        }
      }
      for (int j = i + 1; j < N; j++) {
        if (S[j] == '.') {
          td++;
        } else {
          break;
        }
      }
      if (ts <= td) {
        for (int j = 0; j <= ts; j++) {
          S[i - j] = '.';
        }
        cnt += ts + 1;
      } else {
        for (int j = 0; j < td; j++) {
          S[i + j] = '#';
        }
        cnt += td;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
