Indian summer is such a beautiful time of the year! A girl named Alyona is walking in the forest and picking a bouquet from fallen leaves. Alyona is very choosy — she doesn't take a leaf if it matches the color and the species of the tree of one of the leaves she already has. Find out how many leaves Alyona has picked.

Input

The first line contains an integer n (1 ≤ n ≤ 100) — the number of leaves Alyona has found. The next n lines contain the leaves' descriptions. Each leaf is characterized by the species of the tree it has fallen from and by the color. The species of the trees and colors are given in names, consisting of no more than 10 lowercase Latin letters. A name can not be an empty string. The species of a tree and the color are given in each line separated by a space.

Output

Output the single number — the number of Alyona's leaves.

Examples

Input
5 
birch yellow
maple red
birch yellow
maple yellow
maple green
Output
4
Input
3 
oak yellow
oak yellow
oak yellow
Output
1
这个map很快的,map的键不允许重复,所以有重复的直接过滤了,把两个字符串加起来达到合并的效果,然后插入map,再计算个数就行了
#include <map>
#include <string>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
map<string,int> m; int main()
{
int n;
cin>>n;
getchar();
for(int i=;i<n;i++)
{
string str;
getline(cin,str);
m[str]=;//通过数组下标加入map,也可以用insert函数插入:m.insert(make_pair(str,1));
}
int cnt=;
for(map<string,int>::iterator it=m.begin();it!=m.end();++it)
{
//cout<< it->first<<" "<<it->second<<endl;
cnt++;
}
cout<<cnt<<endl;
return ;
}

最新文章

  1. MD5工具类,提供字符串MD5加密、文件MD5值获取(校验)功能
  2. 学校系统快速js代码
  3. Qt——QLineEdit使用总结
  4. 15个超实用的php正则表达式
  5. javascript对象初读
  6. protel dxp快捷键大全
  7. 九度OJ 1108 堆栈的使用
  8. HTML5与CSS3权威指南.pdf1
  9. iOS开发之让你的应用“动”起来
  10. Servlet:通过初始参数实现权限访问某个文件、页面
  11. 生成命令行接口--google开源的fire使用体验【python-fire】
  12. 使用Java Api 操作HDFS
  13. redhat 6、7配置yum源
  14. [洛谷P1507]NASA的食物计划 以及 对背包问题的整理
  15. ES6-Set and Map
  16. java使用Redis5--分布式存储
  17. 破解ZendStudio 10.1
  18. sed详解---用法及解释
  19. EasyNVR对接EasyCloud视频云平台进行云端录像
  20. C#中的BackgroundWorker控件

热门文章

  1. 笔记本电脑上面安装linux网络配置以及ping通问题
  2. Linux内存 性能调优
  3. java 保护内存操作的方法
  4. c#中数据库字符串的连接几种方式
  5. 有关javamelody的配置
  6. TCP(一)
  7. HIT 1917 2—SAT
  8. bzoj4764: 弹飞大爷 link-cut-tree
  9. Crontab无法自动执行,直接运行脚本却能执行
  10. SSM+Maven的JavaWeb项目中的异常的可能性