#include<stdio.h>
int main()
{
    int n,i,l,r,l1=0,r1=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%d %d",&l,&r);
        if(l==1)l1++;
        if(r==1)r1++;
    }
    if(n-l1<l1)l1=n-l1;
    if(n-r1<r1)l1+=n-r1;
    else l1+=r1;
    printf("%d",l1);

    return 0;
}

http://codeforces.com/contest/248/problem/A

posted on 2013-01-18 23:09  海暗  阅读(299)  评论(0编辑  收藏  举报