#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
void chmin(T &a, const T &b) noexcept {
  if (b < a) a = b;
}
template <class T>
void chmax(T &a, const T &b) noexcept {
  if (a < b) a = b;
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  int n;
  string s;
  cin >> n >> s;
  vector<int> sumb(n + 1, 0), sumw(n + 1, 0);
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#')
      sumb[i + 1]++;
    else
      sumw[i + 1]++;
    sumb[i + 1] += sumb[i];
    sumw[i + 1] += sumw[i];
  }
  int ans = 1001001001;
  for (int i = 0; i < (n); ++i) {
    int res = sumb[i + 1] + (sumw[n] - sumw[i + 1]);
    ;
    chmin(ans, res);
  }
  cout << ans << endl;
  return 0;
}
