# -*- coding: utf-8 -*-

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    n = int(lines[0])
    s = lines[1]

    return (n, s)


def solve(n, s):
    
    ss = []
    count_w = 1
    count_b = -1
    before = s[0]
    for i, c in enumerate(s[1:]):
        if before == c:
            if c == ".":
                count_w = count_w + 1
            else:
                count_b = count_b - 1
        else:
            if before == ".":
                ss.append(count_w)
                count_w = 1
            else:
                ss.append(count_b)
                count_b = -1
        before = c

    if before == ".":
        ss.append(count_w)
    else:
        ss.append(count_b)

    if debug:
        log("ss=%s" % ss)


    if ss[0] > 0:
       ss = ss[1:]
    if ss[-1] < 0:
       ss = ss[:-1]
     
    count_w = sum([e for e in ss if e > 0])
    count_b = sum([e for e in ss if e < 0])

    result = min(count_w, abs(count_b))
    return result


def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()
