N = int(input())
S = input()

ans = 2*10**5
c_b = 0
c_w = 0
for i in range(N):
    if S[i] == '#':
        c_b += 1
    else:
        c_w += 1

ans = min(ans, c_b, c_w)

nums = []
ns = 0
if S[0] == '#':
    nums.append(0)
    ns = 1

count = 0
for i in range(N):
    if S[i] == '.':
        if ns == 0:
            count += 1
        else:
            nums.append(count)
            count = 1
            ns = 1 - ns
    if S[i] == '#':
        if ns == 1:
            count += 1
        else:
            nums.append(count)
            count = 1
            ns = 1 - ns
nums.append(count)

if len(nums) < 3:
    print(0)
    quit()

count = 0
for i in range(0, len(nums), 2):
    if i != 0:
        if nums[i-1] != 0:
            count += nums[i-1]
ans = min(ans, count))

count = 0
for i in range(1, len(nums), 2):
    if nums[i-1] != 0:
        count += nums[i-1]
print(min(ans, count))