#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
int x_pos[4] = {1, 0, -1, 0}, y_pos[4] = {0, 1, 0, -1};
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
char upper(char c) { return c - 0x20; }
char lower(char c) { return c + 0x20; }
void unique_vector(vector<int>& v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  std::fill((T*)array, (T*)(array + N), val);
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int w_cnt = 0;
  for (int i = 0; i < (n); ++i)
    if (s[i] == '.') w_cnt++;
  int b_cnt = 0;
  int ans = INF;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#')
      b_cnt++;
    else
      w_cnt--;
    ans = min(ans, b_cnt + w_cnt);
  }
  cout << ans << endl;
}
