#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  string N;
  cin >> N;
  string m = N;
  bool answer = false;
  int count1 = 0, count2 = 0;
  for (int i = 0; i < a - 1; i++) {
    if (N.at(i) == '#' && N.at(i + 1) == '.') {
      break;
    }
    if (i = a - 1) answer = true;
  }
  if (answer == true) {
    cout << 0 << endl;
  } else {
    for (int i = 0; i < a; i++) {
      if (N.at(i) == '#') {
        N.at(i) = '.';
        count1++;
      }
      for (int j = 0; j < a - 1; j++) {
        if (N.at(j) == '#' && N.at(j + 1) == '.') {
          break;
          if (j == a - 2) {
            answer = true;
          }
        }
      }
      if (answer) {
        break;
      }
    }
    answer = false;
    for (int i = a - 1; i >= 0; i--) {
      if (m.at(i) == '.') {
        m.at(i) = '#';
        count2++;
      }
      for (int j = 0; j < a - 1; j++) {
        if (N.at(j) == '#' && N.at(j + 1) == '.') {
          break;
          if (j == a - 2) {
            answer = true;
          }
        }
      }
      if (answer) {
        break;
      }
    }
    if (count1 <= count2) {
      cout << count1 << endl;
    }
    if (count2 < count1) {
      cout << count2 << endl;
    }
  }
}
