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


public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    }
    static int f(int n) {
        if(n%2==0) return n/2;
        return 3*n+1;
    }
    static boolean check(char [] ca,char [] cb) {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    }
    private static boolean check(LinkedHashMap<Character,Integer> m1,LinkedHashMap<Character,Integer> m2) {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    }
}

class Envelope {
    private int width;
    private int height;

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    public Envelope(int width,int height) {
        this.width = width;
        this.height = height;
    }

    @Override
    public String toString() {
        return width + " " + height;
    }
}

class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    }
    static int f(int n) {
        if(n%2==0) return n/2;
        return 3*n+1;
    }
    static boolean check(char [] ca,char [] cb) {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    }
    private static boolean check(LinkedHashMap<Character,Integer> m1,LinkedHashMap<Character,Integer> m2) {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    }
} Main public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream); out new InputReader.OutputWriter(outputStream) Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int s = in.nextInt(); s in.nextInt() in.nextInt in HashSet<Integer> set = new HashSet<>(); set new HashSet<>() int count = 1; count 1 set.add(s) set.add set s while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        } true {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        } s = f(s) s f(s) f s count++ count if(set.contains(s)) {
                break;
            } set.contains(s) set.contains set s {
                break;
            } break; set.add(s) set.add set s out.println(count) out.println out count out.flush() out.flush out String[] args args static int f(int n) {
        if(n%2==0) return n/2;
        return 3*n+1;
    } f {
        if(n%2==0) return n/2;
        return 3*n+1;
    } if(n%2==0) return n/2; n%2==0 n%2 n 2 0 return n/2; n/2 n 2 return 3*n+1; 3*n+1 3*n 3 n 1 int n n static boolean check(char [] ca,char [] cb) {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    } check {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    } for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        } char c = 'a'; char c = 'a'; c 'a' c<='z' c 'z' c++ c++ c {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        } {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        } HashSet<Character> set = new HashSet<>(); set new HashSet<>() for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            } int i = 0; int i = 0; i 0 i < ca.length i ca.length ca ca.length i++ i++ i {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            } {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            } if(ca[i] == c) {
                    set.add(cb[i]);
                } ca[i] == c ca[i] ca i c {
                    set.add(cb[i]);
                } set.add(cb[i]) set.add set cb[i] cb i if(set.size() > 1) {
                    return false;
                } set.size() > 1 set.size() set.size set 1 {
                    return false;
                } return false; false return  true; true char [] ca ca char [] cb cb private static boolean check(LinkedHashMap<Character,Integer> m1,LinkedHashMap<Character,Integer> m2) {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    } check {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    } if(m1.size()!=m2.size()) return false; m1.size()!=m2.size() m1.size() m1.size m1 m2.size() m2.size m2 return false; false Set<Map.Entry<Character,Integer>> s = m2.entrySet(); s m2.entrySet() m2.entrySet m2 Iterator<Map.Entry<Character,Integer>> it = s.iterator(); it s.iterator() s.iterator s for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        } Map.Entry<Character,Integer> m m1.entrySet() m1.entrySet m1 {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        } {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        } Map.Entry<Character,Integer> next = it.next(); next it.next() it.next it if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            } m.getKey()!=next.getKey() m.getKey() m.getKey m next.getKey() next.getKey next return false; false {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            } if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                } m.getValue() < next.getValue() m.getValue() m.getValue m next.getValue() next.getValue next return false; false {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                } if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    } m.getValue() > next.getValue() m.getValue() m.getValue m next.getValue() next.getValue next {
                        if(m.getValue() < 3) return false;
                    } if(m.getValue() < 3) return false; m.getValue() < 3 m.getValue() m.getValue m 3 return false; false return true; true LinkedHashMap<Character,Integer> m1 m1 LinkedHashMap<Character,Integer> m2 m2 class Envelope {
    private int width;
    private int height;

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    public Envelope(int width,int height) {
        this.width = width;
        this.height = height;
    }

    @Override
    public String toString() {
        return width + " " + height;
    }
} Envelope private int width; width private int height; height public int getHeight() {
        return height;
    } getHeight {
        return height;
    } return height; height public int getWidth() {
        return width;
    } getWidth {
        return width;
    } return width; width public Envelope(int width,int height) {
        this.width = width;
        this.height = height;
    } Envelope {
        this.width = width;
        this.height = height;
    } this.width = width this.width this this.width width this.height = height this.height this this.height height int width width int height height @Override
    public String toString() {
        return width + " " + height;
    } toString {
        return width + " " + height;
    } return width + " " + height; width + " " + height width + " " + height width " " height class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
} InputReader StringTokenizer tokenizer; tokenizer public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    } InputReader {
        super(new InputStreamReader(inputStream), 32768);
    } super(new InputStreamReader(inputStream), 32768) super new InputStreamReader(inputStream) 32768 InputStream inputStream inputStream public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    } InputReader {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    } super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename))) super new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)) String filename filename public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    } next {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        } try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            } catch (IOException e) {
                throw new RuntimeException();
            } IOException e {
                throw new RuntimeException();
            } throw new RuntimeException(); new RuntimeException() {
                tokenizer = new StringTokenizer(readLine());
            } tokenizer = new StringTokenizer(readLine()) tokenizer new StringTokenizer(readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public Integer nextInt() {return Integer.valueOf(next());} nextInt {return Integer.valueOf(next());} return Integer.valueOf(next()); Integer.valueOf(next()) Integer.valueOf Integer next() next public Long nextLong() {return  Long.valueOf(next());} nextLong {return  Long.valueOf(next());} return  Long.valueOf(next()); Long.valueOf(next()) Long.valueOf Long next() next public Double nextDouble() {return Double.valueOf(next());} nextDouble {return Double.valueOf(next());} return Double.valueOf(next()); Double.valueOf(next()) Double.valueOf Double next() next static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    } OutputWriter public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        } OutputWriter {
            super(outputStream);
        } super(outputStream) super outputStream OutputStream outputStream outputStream public OutputWriter(Writer writer) {
            super(writer);
        } OutputWriter {
            super(writer);
        } super(writer) super writer Writer writer writer public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        } OutputWriter {
            super(filename);
        } super(filename) super filename String filename filename public void close() {
            super.close();
        } close {
            super.close();
        } super.close() super.close super PrintWriter BufferedReader public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    }
    static int f(int n) {
        if(n%2==0) return n/2;
        return 3*n+1;
    }
    static boolean check(char [] ca,char [] cb) {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    }
    private static boolean check(LinkedHashMap<Character,Integer> m1,LinkedHashMap<Character,Integer> m2) {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    }
} public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    }
    static int f(int n) {
        if(n%2==0) return n/2;
        return 3*n+1;
    }
    static boolean check(char [] ca,char [] cb) {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    }
    private static boolean check(LinkedHashMap<Character,Integer> m1,LinkedHashMap<Character,Integer> m2) {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    }
} Main
import java.io.*;
import java.util.*;


public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
        Scanner scanner = new Scanner(System.in);

        int s = in.nextInt();
        HashSet<Integer> set = new HashSet<>();
        int count = 1;
        set.add(s);
        while (true) {
            s = f(s);
            count++;
            if(set.contains(s)) {
                break;
            }
            set.add(s);
        }

        out.println(count);
        out.flush();

    }
    static int f(int n) {
        if(n%2==0) return n/2;
        return 3*n+1;
    }
    static boolean check(char [] ca,char [] cb) {
        for (char c = 'a';c<='z';c++) {
            HashSet<Character> set = new HashSet<>();
            for (int i = 0; i < ca.length; i++) {
                if(ca[i] == c) {
                    set.add(cb[i]);
                }
                if(set.size() > 1) {
                    return false;
                }
            }
        }
        return  true;
    }
    private static boolean check(LinkedHashMap<Character,Integer> m1,LinkedHashMap<Character,Integer> m2) {
        if(m1.size()!=m2.size()) return false;
        Set<Map.Entry<Character,Integer>> s = m2.entrySet();
        Iterator<Map.Entry<Character,Integer>> it = s.iterator();
        for(Map.Entry<Character,Integer> m : m1.entrySet()) {
            Map.Entry<Character,Integer> next = it.next();
            if(m.getKey()!=next.getKey()) return false;
            else {
                if(m.getValue() < next.getValue()) return false;
                else {
                    if(m.getValue() > next.getValue()) {
                        if(m.getValue() < 3) return false;
                    }
                }
            }
        }
        return true;
    }
}

class Envelope {
    private int width;
    private int height;

    public int getHeight() {
        return height;
    }

    public int getWidth() {
        return width;
    }

    public Envelope(int width,int height) {
        this.width = width;
        this.height = height;
    }

    @Override
    public String toString() {
        return width + " " + height;
    }
}

class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
}