#include <bits/stdc++.h>
using namespace std;
map<int, int> dp;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> a(5, 0);
  int N;
  string S;
  cin >> N;
  cin >> S;
  int i = 0;
  int ans_dot = count(S.begin(), S.end(), '#');
  int ans_sharp_dot = min(ans_dot, N - ans_dot);
  int ans_double = 0;
  int Slen = S.size();
  int Sleft = S.find('.');
  if (Sleft == std::string::npos) {
    cout << 0 << endl;
    return 0;
  }
  string Sl = S.substr(0, Sleft);
  int Sright = S.substr(Sleft).find('#');
  if (Sright != std::string::npos) {
    string Sr = S.substr(Sright + 1);
    ans_double += count(Sr.begin(), Sr.end(), '.');
  }
  ans_double += count(Sl.begin(), Sl.end(), '#');
  cout << min(ans_double, ans_sharp_dot) << endl;
  return 0;
}
