#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  string s1 = s, s2 = s;
  int ans = 1000000000;
  int w = 0, b = 0;
  vector<int> white(n + 1), black(n + 1);
  if (s[0] == '#') white[0] = 0, black[0] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      white[i + 1] = white[i]++;
      black[i + 1] = black[i];
      w++;
    } else {
      white[i + 1] = white[i];
      black[i + 1] = black[i]++;
      b++;
    }
  }
  for (int i = 0; i < n; i++) {
    int tmp;
    tmp = black[i] + (w - white[i]);
    ans = min(ans, tmp);
  }
  cout << min({b, w, ans}) << endl;
}
