#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <math.h>
#include <bitset>

#define X first
#define Y second
#define vsort(v) sort(v.begin(), v.end())
#define vrev(v) reverse(v.begin(), v.end())
#define vmax_p(v) max_element(v.begin(), v.end())
#define vmin_p(v) min_element(v.begin(), v.end())
#define vmax_idx(v) distance(v.begin(), vmax_p(v))
#define vmin_idx(v) distance(v.begin(), vmin_p(v))
#define vcopy(src, dst) copy(src.begin(), src.end(), back_inserter(dst))
#define P pair

// stoi(s): string to int
// stod(s): string to double

// INT_MAX
// INT_MIN
// LLONG_MAX
// LLONG_MIN
// DBL_MIN
// DBL_MAX
// LDBL_MIN
// LDBL_MAX

// A-Z: 65~90
// a-z: 97~122
// |a-z| = 26

// 2進数変換
// string s = bitset<20>(x).to_string();

using namespace std;
using ll = long long;

void display_vec(vector<int> v)
{
    for (int i = 0; i < v.size(); i++)
    {
        cout << v[i] << endl;
    }
    cout << endl;
}

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

    if (s.find('.') == -1 || s.find('#') == -1)
    {
        cout << 0 << endl;
        return 0;
    }

    int a[n];

    if (s[0] == '.')
    {
        a[0] = 1;
    }
    else
    {
        a[0] = 0;
    }

    for (int i = 1; i < n; i++)
    {
        if (s[i] == '.')
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }

    int min = 1000000, cnt;
    for (int i = 0; i < n; i++)
    {
        cnt = a[n - 1] - a[i] + (i + 1 - a[i]);
        if (cnt < min)
        {
          
            min = cnt;
          if(i == n-1){
            min--;
        }
    }
 
    cout << min << endl;
}
