#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001000;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int ans_1, ans_2, ans_3 = 0, ans_4 = 0;
  int cnt_blk = 0, cnt_wht = 0;
  for (int i = 0; i < N; ++i) {
    if (s[i] == '#')
      ++cnt_blk;
    else
      ++cnt_wht;
  }
  ans_1 = cnt_blk;
  ans_2 = cnt_wht;
  int ch_wht = 0;
  for (int i = 0; i < N; ++i) {
    if (ch_wht == cnt_wht) break;
    if (s[i] == '.')
      ++ch_wht;
    else
      ++ans_3;
  }
  int ch_blk = 0;
  for (int i = N - 1; i >= 0; --i) {
    if (ch_blk == cnt_blk) break;
    if (s[i] == '#')
      ++ch_blk;
    else
      ++ans_4;
  }
  cout << min({ans_1, ans_2, ans_3, ans_4}) << endl;
  return 0;
}
