#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
const long long MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  bool black_frag = false;
  int white_sum_right_of_black = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#')
      black_frag = true;
    else if (black_frag && s.at(i) == '.')
      white_sum_right_of_black += 1;
  }
  bool white_frag = false;
  int black_sum_left_of_white = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s.at(i) == '.')
      white_frag = true;
    else if (white_frag && s.at(i) == '#')
      black_sum_left_of_white += 1;
  }
  ans = min(white_sum_right_of_black, black_sum_left_of_white);
  cout << ans << endl;
}
