Problem description

One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution. Otherwise, the friends won't write the problem's solution.

This contest offers n problems to the participants. For each problem we know, which friend is sure about the solution. Help the friends find the number of problems for which they will write a solution.

Input

The first input line contains a single integer n (1 ≤ n ≤ 1000) — the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Vasya's view on the solution, the third number shows Tonya's view. The numbers on the lines are separated by spaces.

Output

Print a single integer — the number of problems the friends will implement on the contest.

Examples

Input

3
1 1 0
1 1 1
1 0 0

Output

2

Input

2
1 0 0
0 1 1

Output

1

Note

In the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won't take it.

In the second sample the friends will only implement the second problem, as Vasya and Tonya are sure about the solution.

解题思路:每一行3个数中有2个以上(包括2个)是1,就算可以解决该问题,将计数器加1,简单过!

AC代码:

 #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x,num,sum=;
cin>>n;
for(int i=;i<=n;++i){
num=;
for(int j=;j<=;++j){
cin>>x;
if(x)num++;
}
if(num>=)sum++;
}
cout<<sum<<endl;
return ;
}

A - Team的更多相关文章

  1. Configure a VLAN on top of a team with NetworkManager (nmcli) in RHEL7

    SOLUTION VERIFIED September 13 2016 KB1248793 Environment Red Hat Enterprise Linux 7 NetworkManager ...

  2. Create a Team in RHEL7

    SOLUTION VERIFIED September 13 2016 KB2620131 Environment Red Hat Enterprise Linux 7 NetworkManager ...

  3. Team Leader 你不再只是编码, 来炖一锅石头汤吧

    h3{ color: #000; padding: 5px; margin-bottom: 10px; font-weight: bolder; background-color: #ccc; } h ...

  4. Configure bridge on a team interface using NetworkManager in RHEL 7

    SOLUTION IN PROGRESS February 29 2016 KB2181361 environment Red Hat Enterprise Linux 7 Teaming,Bridg ...

  5. BZOJ 4742: [Usaco2016 Dec]Team Building

    4742: [Usaco2016 Dec]Team Building Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 21  Solved: 16[Su ...

  6. 关于 feature team 的一些内容

    矩阵式管理,是常见的经典管理架构.其最早起源于美国的航空航天部门,然后被美国人带到了日本,然后被日本人带到了台湾,然后台湾人带到大陆...矩阵管理最典型的特征是,组织架构按职能与专业划分,项目由跨越部 ...

  7. 病毒四度升级:安天AVL Team揭露一例跨期两年的电信诈骗进化史

    自2014年9月起,安天AVL移动安全团队持续检测到一类基于Android移动平台的间谍类病毒,病毒样本大多伪装成名为"最高人民检察院"的应用.经过反编译逆向分析以及长期的跟踪调查 ...

  8. iOS 真机测试时报错:Provisioning profile "iOS Team Provisioning Profile: XXX” doesn't include the currently selected device “XXX”.

    这几天因工作需要,去给客户演示iOS项目打包的过程.之前演示都是顺利的,但后来客户自己操作时打电话说遇到了问题,出现报错. 就过去看了一下,发现一个很陌生的错误提示: The operation co ...

  9. diff/merge configuration in Team Foundation - common Command and Argument values - MSDN Blogs

    One of the extensibility points we have in Team Foundation V1 is that you can configure any other di ...

  10. 测试环境搭建心得 vs2008+SQL2008 PHP+APACHE+mysql Team Foundation Server2013

    大四即将结束,大学的最后一个假期,找到一份实习工作,担任测试工程师.在过年前的最后一周入职,干了一周的活儿.主要工作就是搭建测试环境. VMware 主要熟悉VMware软件,装系统基本都没什么问题. ...

随机推荐

  1. js兼用性

    1.document.formName.item("itemName") 问题 说明:IE下,可以使用document.formName.item("itemName&q ...

  2. 使用Python的Flask框架,结合Highchart,动态渲染图表(Ajax 请求数据接口)

    参考链接:https://www.highcharts.com.cn/docs/ajax 参考链接中的示例代码是使用php写的,这里改用python写. 需要注意的地方: 1.接口返回的数据格式,这个 ...

  3. nexus3的安装和使用

    参考:https://www.cnblogs.com/2YSP/p/9533506.html http://www.54tianzhisheng.cn/2017/10/14/Nexus3-Maven/ ...

  4. centos 7中 yum安装jdk

    yum安装jdk的好处就是不需要手动再配置环境变量,所有的变量都是自动生成 1.检查系统是否存在jdk,存在删除原版jdk 如果没有信息输出,则表示没有安装jdk rpm -qa |grep java ...

  5. Flask-SQLAlchemy中解决1366报错

    会报下面这个1366的错 安装MySQL驱动(我升级过Python,所以要再装一遍) 本想安装MySQL官方驱动mysql-connector-python的,然而官方目前只支持到3.4 我又懒,所以 ...

  6. 【codeforces 768D】Jon and Orbs

    [题目链接]:http://codeforces.com/contest/768/problem/D [题意] 你有一个水晶; 它每天都会产生一个球??(球有k种) 然后每种球产生的可能性是相同的-& ...

  7. mybatis源码阅读-初始化过程(七)

    说明 mybatis初始化过程 就是解析xml到封装成Configuration对象 供后续使用 SqlSessionFactoryBuilder 代码例子 SqlSessionFactoryBuil ...

  8. 神奇的幻方 noip2015day1 T1

     题目描述 Description 幻方是一种很神奇的N∗N矩阵:它由数字 1,2,3, … … ,N∗N构成,且每行.每列及两条对角线上的数字之和都相同. 当N为奇数时,我们可以通过以下方法构建一个 ...

  9. class类加载机制

    1.类的加载过程 a.加载-链接-初始化-使用-卸载 加载: 查找并加载类的二进制数据 链接: 验证类的正确性,为类的静态变量分配内存,并将其初始化为默认值,把类的符号引用转换为直接引用. 初始化: ...

  10. awr ash addm

    awr ash addm awr addm :基于快照的ash :单独,每秒采样 dbtime=db cpu + wait 柜员忙碌的时间=A做业务的时间+B做业务的时间等待时间=B等待A做业务的时间 ...