def stones(s):
    a = s
    k = 0
    z = 0
    print(a)
    for i in range(len(s)-1):
        if s[i]=='#' and s[i+1]=='.':
            s[i+1] = '#'
            k = k+1
    for i in range(len(a)-1):
        if a[i]=='#' and a[i+1]=='.':
            a[i] = '.'
            z = z+1
    return min(z,k)

n = int(input())
s = list(input())
print(stones(s))