#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
  return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
  return a < b && (a = b, 1);
}
template <class T, class V>
istream& operator>>(istream& ist, pair<T, V>& p) {
  return ist >> p.first >> p.second;
}
template <class T>
ostream& operator<<(ostream& ost, pair<T, T>& p) {
  return ost << p.first << ", " << p.second;
}
template <class T>
istream& operator>>(istream& ist, vector<T>& vs) {
  for (auto& e : vs) ist >> e;
  return ist;
}
int const inf = INT_MAX / 2;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  vector<int> b(N), w(N);
  for (int i = 0; i < (int)N; i++) {
    b[i] = (i ? b[i - 1] : 0) + (S[i] == '#');
    w[N - i - 1] = (i ? w[N - i] : 0) + (S[N - i - 1] == '.');
  }
  int ans = inf;
  for (int i = 0; i < (int)N; i++) {
    ans = min(ans, b[i] + (i < N - 1 ? w[i + 1] : 0));
  }
  cout << ans << endl;
}
