#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::ostream &operator<<(std::ostream &out, vector<T> &v) {
  for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
    out << v[i] << " ";
  out << "\n";
  return out;
}
template <typename T, typename N>
std::ostream &operator<<(std::ostream &out, vector<pair<T, N> > &v) {
  for (size_t i = 0; i < v.size(); ++i)
    out << "(" << v[i].first << ", " << v[i].second << ") ";
  out << "\n";
  return out;
}
template <typename T>
std::ostream &operator<<(std::ostream &out, vector<vector<T> > &v) {
  for (size_t i = 0; i < v.size(); ++i) {
    for (size_t j = 0; j < v[i].size(); ++j) {
      out << v[i][j] << " ";
    }
    out << "\n";
  }
  return out;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string stones;
  cin >> stones;
  int min_colored = 0;
  for (int i = 0; i < n; ++i) {
    if (stones[i] == '#') {
      int black = 0, white = 0;
      for (int j = i; j < n; ++j) {
        if (stones[j] == '#') {
          ++black;
        } else {
          ++white;
        }
      }
      min_colored = INT_MAX;
      int black_on_the_left = 0, white_on_the_right = white;
      for (int j = i; j < n; ++j) {
        if (stones[j] == '#') {
          min_colored =
              min(min_colored, white_on_the_right + black_on_the_left);
          ++black_on_the_left;
        } else {
          --white_on_the_right;
        }
      }
      break;
    }
  }
  cout << min_colored << "\n";
  return 0;
}
