4 1
3 5 7 8
2
 5 1
2 2 2 3 3
3
 4 1
1 1 2 2
2
 10 10
522312461 931001459 598654597 488228616 544064902 21923894 329635457 980089248 988262691 654502493
967529230 543358150 835120075 128123793 809901567 613170206 152157661 479980560 859252956 318029856
 27 9
72 105 100 105 110 103 32 109 101 115 115 97 103 101 115 32 105 110 32 116 101 115 116 99 97 115 101
83 110 101 97 107 32 49 48 48
 4 1
1 1 1 2
2
 7 4
116 111 117 114 105 115 116
112 101 116 114
 4 1
2 2 3 3
2
 7 4
2 2 1 1 1 1 1
2 2 2 1
 6 4
2 4 6 1 3 5
8 10 7 9
 4 2
3 2 1 4
2 3
 1 5
3
3 4 4 4 4
 5 1
1 2 3 4 5
1
 3 10
107 117 110
71 114 101 101 110 71 114 97 112 101
 1 10
1
1 2 3 4 5 6 7 8 9 10
 2 4
1 2
1 1 2 2
 5 2
1 2 2 2 2
1 1

1
 1
 1
 10
 9
 1
 4
 1
 4
 4
 2
 1
 1
 3
 1
 2
 2

import java.io.*;
import java.util.*;
import java.util.stream.*;

import static java.util.stream.Collectors.groupingBy;

public class Main {

    private interface Input extends Closeable {
        String next() throws IOException;

        default int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        default long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }

    private static class StandardInput implements Input {
        private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        private StringTokenizer stringTokenizer;

        @Override
        public void close() throws IOException {
            reader.close();
        }

        @Override
        public String next() throws IOException {
            if (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                stringTokenizer = new StringTokenizer(reader.readLine());
            }
            return stringTokenizer.nextToken();
        }
    }

    public static class MapData {
        Map<Character, List<Integer>> myMap = new HashMap<>();

        public void add(Character character, Integer index) {
            if (!myMap.containsKey(character)) {
                List<Integer> myList = new ArrayList<>();
                myList.add(index);
                myMap.put(character, myList);
            } else {
                List<Integer> myList = myMap.get(character);
                myList.add(index);
            }
        }

        public List<Integer> getAvailableIndex() {
            return myMap.entrySet().stream().map(Map.Entry::getValue).flatMap(List::stream).collect(Collectors.toList());
        }

        public int pop(Character character) {
            if (!myMap.containsKey(character))
                return popFromQuestion();
            else {
                List<Integer> myList = myMap.get(character);
                if (myList.size() > 0)
                    return myList.remove(myList.size() - 1);
                else return popFromQuestion();
            }
        }

        private int popFromQuestion() {
            if (!myMap.containsKey('?'))
                return -1;
            else {
                List<Integer> myList = myMap.get('?');
                if (myList.size() > 0)
                    return myList.remove(myList.size() - 1);
                else return -1;
            }
        }
    }

    public static class MyObject {
        int index;
        char character;


        MyObject(int index, char j) {
            this.index = index;
            this.character = j;
        }
    }

    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        Map<Boolean, List<Integer>> chests = IntStream.range(0, n).boxed().map(index -> scanner.nextInt()).collect(Collectors.partitioningBy(x -> x % 2 == 0));
        Map<Boolean, List<Integer>> keys = IntStream.range(0, m).boxed().map(index -> scanner.nextInt()).collect(Collectors.partitioningBy(x -> x % 2 == 0));

        int result = Math.min(chests.getOrDefault(Boolean.FALSE, Collections.emptyList()).size(), keys.getOrDefault(Boolean.TRUE, Collections.emptyList()).size())
                + Math.min(chests.getOrDefault(Boolean.TRUE, Collections.emptyList()).size(), keys.getOrDefault(Boolean.FALSE, Collections.emptyList()).size());

        System.out.println(result);
    }

    private static boolean check(List<Integer> data, Integer d) {
        return (checkEqual(data, d, data.get(0)) || checkEqual(data, d, data.get(0) + d));
    }

    private static boolean checkEqual(List<Integer> data, Integer d, int value) {
        return data.stream().allMatch(currentValue -> currentValue == value || currentValue - d == value || currentValue + d == value);
    }
}