#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  bool black = false;
  int ans;
  int cnt = 0;
  for (int i = (0); i < (N); ++i) {
    if (S[i] == '#' and !black)
      black = true;
    else if (black and S[i] == '.')
      cnt++;
  }
  ans = cnt;
  bool white = false;
  cnt = 0;
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '.' and !white)
      white = true;
    else if (white and S[i] == '#')
      cnt++;
  }
  ans = min(ans, cnt);
  cout << ans << endl;
  return 0;
}
