#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string S;
  cin >> N >> S;
  long long rsl = 0, left_sharp_num = 0, right_dot_num = 0;
  bool flag_sharp = false, flag_dot = false;
  for (int i = N - 1; i >= 0; i--) {
    if (!flag_dot and S[i] == '.')
      flag_dot = true;
    else if (flag_dot and S[i] == '#')
      right_dot_num++;
  }
  for (int i = (int)0; i < (int)N; i++) {
    if (!flag_sharp and S[i] == '#')
      flag_sharp = true;
    else if (flag_sharp and S[i] == '.')
      left_sharp_num++;
  }
  rsl = min(right_dot_num, left_sharp_num);
  cout << rsl << endl;
}
