#include <bits/stdc++.h>
using namespace std;
using namespace std;
int manhattan_distance(string s1, string s2) {
  assert(s1.size() == s2.size());
  int ret = 0;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] != s2[i]) {
      ret++;
    }
  }
  return ret;
}
template <typename T>
void dump_vec(vector<T> vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << i << ": " << vec[i] << endl;
  }
}
template <typename T, typename S>
void dump_dic(map<T, S> dic) {
  for (auto v : dic) {
    cout << v.first << ": " << v.second << endl;
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int min = manhattan_distance(s, string(n, '.'));
  int tmp = manhattan_distance(s, string(n, '#'));
  if (tmp < min) {
    min = tmp;
  }
  tmp = manhattan_distance(s, string(n - 1, '.') + "#");
  if (tmp < min) {
    min = tmp;
  }
  cout << min << endl;
  return 0;
}
