#include <bits/stdc++.h>
using namespace std;
struct _I {
  _I() {
    cin.tie(0);
    ios::sync_with_stdio(false);
  }
} __I;
template <class T>
istream& operator>>(istream& s, vector<T>& v) {
  for (T& x : v) {
    s >> x;
  }
  return s;
}
template <class T>
void cout_h(const vector<T>& c, int n = INT_MAX) {
  for (int i = 0; i < (min(n, (int)c.size())); i++)
    cout << c[i] << (i == c.size() - 1 ? "\n" : " ");
}
template <class T>
inline bool chmin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool chmax(T& a, T b) {
  return a < b ? a = b, true : false;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string::size_type pos_l_black = s.find('#');
  int c_l_white = pos_l_black == string::npos ? n : pos_l_black;
  string::size_type pos_r_white = s.rfind('.');
  int c_r_black = pos_r_white == string::npos ? n : n - pos_r_white - 1;
  int c_white = count(s.begin(), s.end(), '.');
  int c_black = n - c_white;
  cout << min(c_white - c_l_white, c_black - c_r_black) << endl;
}
