#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
inline void init() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main() {
  init();
  int N;
  cin >> N;
  string s;
  cin >> s;
  vector<int> black(N, 0);
  for (int(i) = (0); (i) < (N); ++(i)) {
    if (s[i] == '#') black[i]++;
  }
  for (int(i) = (1); (i) < (N); ++(i)) black[i] += black[i - 1];
  int ans = min(black[N - 1], N - black[N - 1]);
  for (int(i) = (1); (i) < (N); ++(i)) {
    chmin(ans, black[i - 1] + N - (black[N - 1] - black[i - 1]));
  }
  cout << ans << "\n";
  return 0;
}
