#include <bits/stdc++.h>
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}
template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}
template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}
void debug_out() { std::cerr << '\n'; }
template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}
using namespace std;
using int64 = long long;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int black = 0;
  int white = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      black++;
    else
      white++;
  };
  int left_black = 0;
  int left_white = 0;
  int ans = 1e6;
  if (S[0] == '#') left_black++;
  for (int i = 1; i < N; i++) {
    if (S[i] == '#')
      left_black++;
    else
      left_white++;
    if ((S[i - 1] == '#') & (S[i] == '.')) {
      int tmp = left_black + (white - left_white);
      ;
      ans = min(ans, tmp);
    }
  }
  if (ans == 1e6) ans = 0;
  cout << min(ans, min(white, black)) << endl;
  return 0;
}
