F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Download

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 894    Accepted Submission(s): 452


Problem Description
Computer networks, the widespread sharing of information among groups of computers and their users, are a central part of the information age. In this age, every local personal computer(PC) can download applications and documents from the distance database, which makes it convenient to our entertainment by using the internet.

CC is a such fanatical lover of TV plays. Each TV play is consisted by a lot number of sections. When he open his download software and select one of his favourite TV plays, a "section selected window" jumped out. "Please mark the sections you want to download~".

Each section has its CheckBox to be marked stands for choosing this section or not.
There are two special buttons as follow:
1, All-clicked: you can mark all of section with 'ˇĚ' by click this button.
2, Inverse-clicked: you can change each section to its inverse state by click this button.

At first, the state of each section is in disorder, and there is no need to CC to download all of the sections in this TV play. When he are about to begin his crazy clicking, he come up with a good idea that finding the minimum times of click by programming. Now he tell you the information of the original download window, can you tell him how many click times at least to choose the sections he wants to download.
 

Input
Input contains multiple test cases. Each test case contains three lines:
The first line contains only one number N (5 <= N <= 50) indicating the total number of sections.
The second line is a string S only consisted by '0' and '1', the ith charactor is stand for the ith section of TV play, '1' is stand for the 'ˇĚ' state and '0' is not.
The third line is a string T, just like S, it shows the sections CC wants to download.
You can assume the length of S and T are equal to N.
 

Output
For each case, you are required to output the minimum count of clicks to choose the expected section(s).
 

Sample Input
5 00010 10111 5 10101 01010
 

Sample Output
2 1
 

Author
possessor WC
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-30 21:02:14, Gzip enabled