#C837. Maximum Triplets
Maximum Triplets
Maximum Triplets
You are given n marbles, each colored red, blue, or green, represented by the integers 1, 2, and 3 respectively. Your task is to determine the maximum number of triplets you can form such that each triplet contains one red, one blue, and one green marble.
The solution is simply the minimum number of marbles among the three colors, since that determines the number of complete triplets that can be made.
Input: The input is given via standard input (stdin).
Output: The output should be printed to standard output (stdout), consisting of a single integer representing the maximum number of triplets.
inputFormat
The first line contains a single integer n, which is the number of marbles.
The second line contains n space-separated integers. Each integer is either 1 (red), 2 (blue), or 3 (green).
outputFormat
Output a single integer representing the maximum number of triplets that can be formed.
## sample6
1 2 1 3 2 3
2