#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;
template <typename T>
void say(T s) {
  cout << s << "\n";
}
template <typename T>
void say(vector<T> s) {
  auto itr = s.begin();
  cout << *(itr++);
  while (itr != s.end()) {
    cout << " " << *(itr++);
  }
  cout << "\n";
}
template <typename T>
void say(vector<T> s, char r) {
  auto itr = s.begin();
  cout << *(itr++);
  while (itr != s.end()) {
    cout << r << *(itr++);
  }
  cout << "\n";
}
void yn(bool b) {
  if (b)
    say("yes");
  else
    say("no");
}
void Yn(bool b) {
  if (b)
    say("Yes");
  else
    say("No");
}
void YN(bool b) {
  if (b)
    say("YES");
  else
    say("NO");
}
void Yay(bool b) {
  if (b)
    say("Yay!");
  else
    say(":(");
}
template <typename T>
void maxi(T& a, T b) {
  a = max(a, b);
}
template <typename T>
void mini(T& a, T b) {
  a = min(a, b);
}
void exact_say(double x) {
  cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}
template <typename T>
vector<vector<T>> fill_vector(int h, int w, T val) {
  vector<vector<T>> ret;
  vector<T> v(w, val);
  for (int i = 0; i < h; ++i) ret.push_back(v);
  return ret;
}
template <typename T>
T maxi(vector<T> v) {
  T ret = v[0];
  for (int i = 1; i < v.size(); ++i) maxi(ret, v[i]);
  return ret;
}
template <typename T>
T mini(vector<T> v) {
  T ret = v[0];
  for (int i = 1; i < v.size(); ++i) mini(ret, v[i]);
  return ret;
}
signed main() {
  int n;
  cin >> n;
  ;
  string s;
  cin >> s;
  ;
  vi black(n + 1), white(n + 1);
  black[0] = 0;
  for (int i = 0; i < n; ++i) {
    black[i + 1] = black[i] + (s[i] == '#');
  }
  black.push_back(black.back());
  white[n] = 0;
  for (int i = n - 1; i >= 0; --i) {
    white[i] = white[i + 1] + (s[i] == '.');
  }
  white.insert(white.begin(), white.front());
  int ans = INT_MAX;
  for (int i = 0; i < n + 2; ++i) mini(ans, white[i] + black[i]);
  say(ans);
}
