# -*- coding: utf-8 -*-
"""
C - Stones
https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

"""
import sys


def solve(N, S):
    ans1 = 0
    prev = '@'
    for s in S:
        if prev == '#' and s == '.':
            ans1 += 1
            prev = '#'
        else:
            prev = s

    ans2 = 0
    nex = '@'
    for s in S[::-1]:
        if nex == '.' and s == '#':
            ans2 += 1
            nex = '#'
        else:
            nex = s
    return min(ans1, ans2)



def main(args):
    N = int(input())
    S = input()
    ans = solve(N, S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
