305005: CF952E. Cheese Board
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Cheese Board
题意翻译
第一行输入包含一个整数N(1<=N<=100)-您拥有的奶酪数量。 下一个N行描述了你拥有的奶酪。每行包含两个以空格分隔的字符串:奶酪的名称及其类型。名称是一串小写的英文字母,长度在1到10个字符之间。类型是"软"或"硬"。所有奶酪名称都是不同的。 软奶酪代表方块的一种“颜色”,硬奶酪代表另一种。找出方形“棋盘”的最小尺寸,在该棋盘上可以以这样的方式布置给定的奶酪,使得软奶酪和硬奶酪交替,并且相同类型的奶酪永远不会占据相邻的方块。题目描述
Not to be confused with [chessboard](https://en.wikipedia.org/wiki/Chessboard). ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF952E/d088bd192ec24adc1aa0fd2afc4c2fb2b7ee4531.png)输入输出格式
输入格式
The first line of input contains a single integer $ N $ ( $ 1<=N<=100 $ ) — the number of cheeses you have. The next $ N $ lines describe the cheeses you have. Each line contains two space-separated strings: the name of the cheese and its type. The name is a string of lowercase English letters between 1 and 10 characters long. The type is either "soft" or "hard. All cheese names are distinct.
输出格式
Output a single number.
输入输出样例
输入样例 #1
9
brie soft
camembert soft
feta soft
goat soft
muenster soft
asiago hard
cheddar hard
gouda hard
swiss hard
输出样例 #1
3
输入样例 #2
6
parmesan hard
emmental hard
edam hard
colby hard
gruyere hard
asiago hard
输出样例 #2
4