def c_stones(N, S):
    import itertools
    s = [(k, len(list(v))) for k, v in itertools.groupby(S)]
    if s[0][0] == '.':
        del s[0]
    if len(s) > 0 and s[-1][0] == '#':
        del s[-1]
    ans1, ans2 = 0, 0
    for i in range(len(s)):
        if i % 2 == 0:
            ans1 += s[i][1]
        else:
            ans2 += s[i][1]
    return min(ans1, ans2)

N = int(input())
S = input()
print(c_stones(N, S))
