n = int(input())
s = list(input())
for i in range(n):
    if i == 0:
        ans = 0
        if s[i] == ".":
            flag = False
        else:
            flag = True
    elif not flag:
        if s[i] == "#":
            flag = True
    else:
        if s[i] == ".":
            ans += 1
for i in range(n):
    if i == 0:
        if s[i] == "#":
            ans2 = 1
        else:
            ans2 = 0
            flag = False
    elif i == n - 1:
        if not flag:
            ans2 = 0
    else:
        if s[i] == "#":
            ans2 += 1
        else:
            flag = True
print(min(ans, ans2))
