#include <bits/stdc++.h>
using namespace std;
int min_change(int N, string S) {
  int kuro = 0, shiro = 0;
  int k_flag = 0, s_flag = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') k_flag = 1;
    if (S[i] == '.' && k_flag == 1) kuro++;
    if (S[N - i - 1] == '.') s_flag = 1;
    if (S[N - i - 1] == '#' && s_flag == 1) shiro++;
  }
  return min(kuro, shiro);
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  cout << min_change(N, S) << endl;
  return 0;
}
