#include <bits/stdc++.h>
using namespace std;
bool test(long long N, string S) {
  bool black = false;
  for (int i = 0; i < N; ++i) {
    if (S.at(i) == '.' && black == false) {
      continue;
    } else if (S.at(i) == '#' && black == false) {
      black = true;
      continue;
    } else if (S.at(i) == '#' && black == true) {
      continue;
    } else {
      return false;
    }
  }
  return true;
}
void solve(long long N, std::string S) {
  priority_queue<pair<int, string>, vector<pair<int, string>>,
                 greater<pair<int, string>>>
      que;
  que.push(pair<int, string>(0, S));
  while (!que.empty()) {
    pair<int, string> now = que.top();
    que.pop();
    if (test(N, now.second)) {
      cout << now.first << endl;
      return;
    }
    for (int i = N - 1; i >= 0; --i) {
      if (now.second.at(i) == '.') {
        string new_string = now.second;
        new_string.at(i) = '#';
        que.push(pair<int, string>(now.first + 1, new_string));
      }
    }
    for (int i = 0; i < N; ++i) {
      if (now.second.at(i) == '#') {
        string new_string = now.second;
        new_string.at(i) = '.';
        que.push(pair<int, string>(now.first + 1, new_string));
      }
    }
  }
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
