#!/bin/python import sys def minimumNumber(n, password): count = 0 numbers = "0123456789" upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" lower = "abcdefghijklmnopqrstuvwxyz" special = "!@#$%^&*()-+" if not any(x in numbers for x in password): count = count + 1 if not any(x in upper for x in password): count = count + 1 if not any(x in lower for x in password): count = count + 1 if not any(x in special for x in password): count = count + 1 if n+count < 6: count = count + (6-(n+count)) return count if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer