#include <bits/stdc++.h>
constexpr long long MOD = 1000000007;
int main() {
  int N;
  std::cin >> N;
  std::string s;
  std::cin >> s;
  int i;
  for (i = 0; i < s.size() - 1; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') break;
  }
  int ans = 0;
  for (int j = i + 1; j < N; ++j) {
    if (s[j] == '.') ++ans;
  }
  for (i = N - 1; 0 < i; --i) {
    if (s[i] == '.' && s[i - 1] == '#') break;
  }
  int ans1 = 0;
  for (int j = i - 1; 0 <= j; --j) {
    if (s[j] == '#') ++ans1;
  }
  std::cout << std::min(ans, ans1) << std::endl;
  return 0;
}
