#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

typedef std::uint64_t u64;
typedef std::int64_t  i64;
typedef std::uint32_t u32;
typedef std::int32_t  i32;

using namespace std;

#define swap(a, b)    do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while(0)
#define repd(i, a, b) for(typeof(b) i = a; i < (b); ++i)
#define rep(i, n)     repd(i, 0, n)
#define dump(x)       cerr << #x << " = " << (x) << endl
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl

int main(int argc, const char* argv[]) {
	u64 n;
	string s;

	cin >> n >> s;

	u64 w[n+1] = {0};
	u64 b[n] = {0};

	rep(i, n) {
		if(s[i] == '.') {
			w[i+1] = w[i] + 1;
		} else {
			w[i+1] = w[i];
		}
	}

	if(w[n] == n || w[n] == 0) {
		cout << 0 << endl;
		return 0;
	}

	u64 ret = w[n];
	repd(i, 1, n+1) {
		u64 tmp = i - w[i] + (w[n] - w[i]);
		if(tmp < ret) ret = tmp;
	}

	if(ret == 0) 

	cout << ret << endl;
	return 0;
}
