#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
bool in_field(int W, int H, int x, int y) {
  return (0 <= x && x < W) && (0 <= y && y < H);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "\t";
  }
  return s;
}
int N;
string S;
int main() {
  cin >> N >> S;
  int b = 0, w = 0;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    if (S[i] == '.') {
      w++;
    }
  }
  int ans = numeric_limits<int>::max();
  bool find = false;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    if (S[i] == '#' && S[i + 1] == '.') {
      find = true;
      ans = min(b + w, ans);
    }
    if (S[i] == '#') {
      b++;
    }
    if (S[i] == '.') {
      w--;
    }
  }
  if (find) {
    cout << ans << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
