jiahuimbzuai/CoQuIR huggingface dataset:
//  [swift]
let s=readLine()!
var seta:Set<Character>=[]
var judge=0
for x in s{
  seta.insert(x)
}
for x in seta{
  var count=0
  for y in s{
    if x==y{
      count+=1
    }
  }
  if count==2{
    judge+=1
  }
}

if judge==3{
  print("Yes")
}else{
  print("No")
}
//  [swift]
let s=readLine()!
var seta:Set<Character>=[]
var judge=0
for x in s{
  seta.insert(x)
}
var count=0
for x in seta{
  for y in s{
    if x==y{
      count+=1
    }
  }
}
if (count==4) && (judge==1){
  print("Yes")
}else{
  print("No")
}
//  [typescript]
import { readFileSync } from 'fs'

function main(input: string) {
  const list = input.trim().split('')

  const result = list.every(char =>
    list.filter(c => c === char).length === 2
  )

  console.log(result ? 'Yes' : 'No')
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
'use strict'
const main = (input: string) => {
    const std = new Set(input.trim().split(''))
    std.size == 2 ? console.log("Yes") : console.log("No")
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
import { readFileSync } from 'fs'
 
function main(input: string) {
  const list = input.trim().split('')
 
  const result = list.every(char =>
    list.filter(c => c === char).length === 2
  )
 
  console.log(result ? 'Yes' : 'No')
}
 
main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
import * as fs from 'fs';

//in
// SASA
//out
// Yes
const main: any = (inp: string) => {
    if (inp[0] + inp[1] === inp[2] + inp[3]) {
        console.log('Yes');
    } else {
        console.log('No');
    }
};
main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<a.length;i+=2){if(op==='=='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const ceil=a=>{return Math.ceil(a)};const srin=s=>{const a:string[]=[];rep(s,()=>a.push(sin()));return a};let ssinteger=-1;const ssin=()=>{ssinteger++;return input[0][ssinteger]};
const main = ()=>{
  let a=[ssin(),ssin(),ssin(),ssin()].sort()
  out(a[0]==a[1]&&a[2]==a[3]?'Yes':'No')
}
main()
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: Set<String> = new Set(input.split(''))
    std.size == 2 ? console.log("Yes") : console.log("No")
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [python]
print(len(set(open(0)))-1)
//  [python]
N,*S=open(0);print(len(set(S)))
//  [python]
# C - gacha
def main():
    _, *S = open(0)
    print(len(set(S)))


if __name__ == "__main__":
    main()
//  [python]
N = int(input())
lst = []
count = 0
for _ in range(N):
    s = input()
    if not s in lst:
        lst.append(s)
        count += 1
print(count)
//  [python]
N = int(input())
count = 0
for _ in range(N):
    s = input()
    if not s in lst:
        count += 1
print(count)
//  [python]
N = int(input())
lst = []
for _ in range(N):
    s = input()
    if not s in lst:
        lst.append(s)
print(len(lst))
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
    public  static void main(String[] args) {
        FastScanner sc = new FastScanner();
        String text = "";
        List<String> listA = new ArrayList<>();
        int count = Integer.parseInt(sc.next());

        for(int i = 0; i < count; i++) {
            text = sc.next();
            listA.add(text);

        }
        List<String> listB = new ArrayList<String>(new HashSet<>(listA));
        System.out.print(listB.size());
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[]args) {
        try {
        
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());

      HashSet<String> lottery = new HashSet<String>();
      for(int i = 0;i<n;i++) {
          String words = br.readLine();
          lottery.add(words);
      }
System.out.println(lottery.size());

        }catch(Exception e) {
        }
    }

    
}
//  [java]
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	static PrintStream o = System.out;
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] get = new String[n];
		int res = 0;
		sc.nextLine();
		for (int i = 0; i < n; i++) {
			String one = sc.nextLine();
			boolean find = false;
			for (int j = 0; j < res; j++) {
				if (one.equals(get[j])) {
					find = true;
					break;
				}
			}
			if (!find) {
				get[res] = one;
				res++;
			}
		}
		o.println(res);
	}
}
//  [java]
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	static PrintStream o = System.out;
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<String> get = new ArrayList<String>();
		int res = 0;
		sc.nextLine();
		for (int i = 0; i < n; i++) {
			String one = sc.nextLine();
			boolean find = false;
			for (String string : get) {
				if (string.equals(one)) {
					find = true;
					break;
				}
			}
			if (!find) {
				get.add(one);
				res++;
			}
		}
		o.println(res);
	}
}
//  [cpp]
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

void pakuri_sort(int N, ll A[]) {
	const int b = 8;
	ll tmp[200001];
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	ll S[200000];
	int N = 0;
	char c;
	while ((c = getchar_unlocked()) >= '0') N = N * 10 + c - '0';

	rep(i, N) {
		ll s = 1;
		while ((c = getchar_unlocked()) >= 'a') s = s * 26 + c - 'a';
		S[i] = s;
	}

	pakuri_sort(N, S);

	int kotae = 0;
	ll mae = -1;
	rep(i, N) {
		if (mae != S[i]) {
			kotae++;
			mae = S[i];
		}
	}

	printf("%d\n", kotae);


	Would you please return 0;
}
//  [cpp]
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

void pakuri_sort(int N, ll A[]) {
	const int b = 12;
	ll tmp[200001];
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	ll S[200000];
	int N = 0;
	char c;
	while ((c = getchar_unlocked()) >= '0') N = N * 10 + c - '0';

	rep(i, N) {
		ll s = 1;
		while ((c = getchar_unlocked()) >= 'a') s = s * 26 + c - 'a';
		S[i] = s;
	}

	pakuri_sort(N, S);

	int kotae = 0;
	ll mae = -1;
	rep(i, N) {
		if (mae != S[i]) {
			kotae++;
			mae = S[i];
		}
	}

	printf("%d\n", kotae);


	Would you please return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define int  long long int
#define fi first
#define se second
#define pb push_back
#define soo(v) sort(v.rbegin(),v.rend())
#define so(v) sort(v.begin(),v.end())
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define endl '\n'
#define dbv(v) cout<<endl;cout<<#v<<"-->> ";for(auto it:v){cout<<it<<" ";}cout<<endl;
#define dbm(m)cout<<endl;cout<<#m<<"-->> ";for(auto it:m){cout<<it.fi<<" "<<it.se.fi<<" "<<it.se.se<<endl;}
#define dbs(s)cout<<endl;cout<<#s<<"-->> ";for(auto it:s){cout<<it<<" ";}cout<<endl;
#define mod 1000000007
#define db1(x) cout<<#x<<"="<<x<<endl;
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl;
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<endl;
#define mx 1e18
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v)  *min_element(v.begin(),v.end())
#define double long double
#define re(s) reverse(s.begin(),s.end())
#define io std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
int powe(int x,int n)
{
  if(n==0)return 1;
  if(n%2==0)
    return powe((x%mod*x%mod)%mod,n/2)%mod;
  return (x%mod*powe((x%mod*x%mod)%mod,(n-1)/2))%mod;
}
int gcd(int A,int B)
{
  if(B==0)return A;
  return gcd(B,A%B);
}


int32_t main()
{
  io
  int n;
  cin>>n;
  map<string,int>mm;string ss;
  for(int i=0;i<,n;i++){cin>>ss;mm[ss]++;}
    cout<<mm.size()<<endl;

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
string a[100005];
long long n,k;

int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    for(int i=0;i<=n;i++){
        if(a[i]!=a[i+1])k++;
    }
    cout<<k;
    return 0;}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
string a[100005];
long long n,k;

int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    for(int i=0;i<n;i++){
        if(a[i]!=a[i+1])k++;
    }
    cout<<k;
    return 0;}
//  [c]
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

uint32_t nextpint(void){ char c=getchar_unlocked(); while(c<'0'||'9'<c) c=getchar_unlocked(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return x; }
uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; }
void printint(uint32_t x){ if(x<0){x=-x; putchar_unlocked('-');}else if(x==0){putchar_unlocked('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar_unlocked(s[i]); putchar_unlocked('\n'); }
void rsort_str(void *base, const int count, const int size);

char str[200000][11];

int main(void){
	uint32_t n=nextpint();
	for(uint32_t i=0; i<n; i++){
		nextstr(str[i]);
	}
	rsort_str(str, n, 11);
	uint32_t ans=1;
	for(uint32_t i=1; i<n; i++){
		if(strcmp(str[i], str[i-1])) ans++;
	}
	printint(ans);
}

void rsort_str(void *base, const int count, const int size){
	char (*a)[size]=base;
	char (*b)[size]=malloc(count*size);
	int c[0x100];
	for(int j=size-1; j>=0; j--){
		memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[a[i][j]]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ memcpy(&b[--c[a[i][j]]], a[i], size); }{void *t=a; a=b; b=t;}
	}
	if((size&1)==0){
		free(b);
	}else{
		memcpy(b, a, count*size);
		free(a);
	}
}
//  [c]
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

uint32_t nextpint(void){ char c=getchar_unlocked(); while(c<'0'||'9'<c) c=getchar_unlocked(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return x; }
void printint(uint32_t x){ if(x<0){x=-x; putchar_unlocked('-');}else if(x==0){putchar_unlocked('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar_unlocked(s[i]); putchar_unlocked('\n'); }
void rsort_str(void *base, const int count, const int size);

char str[200000][11];

int main(void){
	uint32_t n=nextpint();
	for(uint32_t i=0; i<n; i++){
		char *s=str[i];
		char c=getchar_unlocked();
		while(c!=' '&&c!='\n'){ *s++=c; c=getchar_unlocked(); }
		*s='\0';
	}
	rsort_str(str, n, 11);
	uint32_t ans=1;
	for(uint32_t i=1; i<n; i++){
		if(strcmp(str[i], str[i-1])) ans++;
	}
	printint(ans);
}

void rsort_str(void *base, const int count, const int size){
	char (*a)[size]=base;
	char (*b)[size]=malloc(count*size);
	int c[0x100];
	for(int j=9; j>=0; j--){
		memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[a[i][j]]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ memcpy(&b[--c[a[i][j]]], a[i], size); }{void *t=a; a=b; b=t;}
	}
	free(b);
}
//  [c]
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

uint32_t nextpint(void){ char c=getchar_unlocked(); while(c<'0'||'9'<c) c=getchar_unlocked(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return x; }
uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; }
void printint(uint32_t x){ if(x<0){x=-x; putchar_unlocked('-');}else if(x==0){putchar_unlocked('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar_unlocked(s[i]); putchar_unlocked('\n'); }
void rsort_str(void *base, const int count, const int size);

char str[200000][11];

int main(void){
	uint32_t n=nextpint();
	for(uint32_t i=0; i<n; i++){
		nextstr(str[i]);
	}
	rsort_str(str, n, 11);
	uint32_t ans=1;
	for(uint32_t i=1; i<n; i++){
		if(strcmp(str[i], str[i-1])) ans++;
	}
	printint(ans);
}

void rsort_str(void *base, const int count, const int size){
	char (*a)[size]=base;
	char (*b)[size]=malloc(count*size);
	int c[0x100];
	for(int j=9; j>=0; j--){
		memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[a[i][j]]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ memcpy(&b[--c[a[i][j]]], a[i], size); }{void *t=a; a=b; b=t;}
	}
	free(b);
}
//  [c]
#include<stdio.h>

int main(void){
  int j=1,N,count=0;
  char s[][10];
  scanf("%d",&N);
  for(int i=0;i<N;i++)
    scanf("%s",s[i]);
  
  for(int k=j-1;k<N-1;k++){
    for(j;j<N,j++){
      if(s[k]==s[j])
        count++;
    }
    j=k+2;
  }
  printf("%d\n",count);
  
  return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<time.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define INI(n) scanf("%d",&n)
#define INL(n) scanf("%lld",&n)
#define INF 10000000000
#define mod 1000000007
#define X 100000
#define N 20
#define M 46
typedef long long int ll;
ll finv[X];
ll fac[X];
ll inv[X];
ll usort(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
ll dsort(const void *a, const void *b){return *(ll*)b-*(ll*)a;}
ll ssort(const void *a, const void *b){return strcmp((char*)a,(char*)b);}
void Iswap(int *a,int *b){
  int t=*a;
  *a=*b;
  *b=t;
}
void Fswap(double *a,double *b){
  double t=*a;
  *a=*b;
  *b=t;
}
void Lswap(ll *a,ll *b){
  ll t=*a;
  *a=*b;
  *b=t;
}
ll min(ll a,ll b){
  if(a>b)return b;
  return a;
}
ll max(ll a,ll b){
  if(a>b)return a;
  return b;
}
ll z(ll a){return max(a,-a);}
ll gcd(ll a,ll b){if(!b){return a;}else{return gcd(b,a%b);}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll kt(ll a){
  ll sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
ll ks(ll a){
  ll sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
void nCrReady(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for (ll i=2;i<X;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
ll nCr(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%mod)%mod;}
ll modpow(ll a,ll n){
  ll res=1;
  while(n>0){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}
int main(void){
  int n;
  INI(n);
  char s[n][200001];
  FOR(i,n)scanf("%s",s[i]);
  qsort(s,n,sizeof(s[0]),ssort);
  int ans=1;
  FOR(i,n-1){
    if(strcmp(s[i],s[i+1])){
      ans++;
    }
  }
  PRN(ans);
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int		g_node_count = 0;

typedef	struct	s_btree
{
	char			*item;
	struct s_btree	*left;
	struct s_btree	*right;
}					t_btree;

t_btree	*btree_create_element(void *str)
{
	t_btree	*ret;

	ret = malloc(sizeof(t_btree));
	ret->item = str;
	ret->left = 0;
	ret->right = 0;
	return (ret);
}

int		btree_search_item(t_btree *root, void *item)
{
	int	ret;

	if (!root)
		return (0);
	if ((ret = btree_search_item(root->left, item)))
		return (ret);
	if (!strcmp(root->item, item))
		return (1);
	if ((ret = btree_search_item(root->right, item)))
		return (ret);
	return (0);
}

void	btree_insert_item(t_btree **root, void *item)
{
	if (!*root)
	{
		*root = btree_create_element(item);
		return ;
	}
	if (strcmp((*root)->item, item) < 0)
	{
		if (!(*root)->left)
		{
			(*root)->left = btree_create_element(item);
			return ;
		}
		btree_insert_item(&(*root)->left, item);
	}
	else
	{
		if (!(*root)->right)
		{
			(*root)->right = btree_create_element(item);
			return ;
		}
		btree_insert_item(&(*root)->right, item);
	}
}

void	btree_count_node(t_btree *root)
{
	if (root->left)
		btree_count_node(root->left);
	g_node_count++;
	if (root->right)
		btree_count_node(root->right);
}

int		main(void)
{
	int		N;
	int		i;
	char	(*S)[11];
	t_btree	*tree;

	scanf("%d", &N);
	S = malloc(sizeof(char) * N * 11);
	for (i = 0; i < N; i++)
		scanf("%s", S[i]);
	tree = 0;
	for (i = 0; i < N; i++)
	{
		if (!btree_search_item(tree, S[i]))
			btree_insert_item(&tree, S[i]);
	}
	btree_count_node(tree);
	printf("%d\n", g_node_count);
	return (0);
}
//  [javascript]
'use strict';
const main = arg => {
  const input = arg.trim().split('\n');

  const setItems = new Set(input);
  console.log(setItems.size - 1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
let input = require('fs').readFileSync('/dev/stdin', 'utf8')
.split(/\n| /)
// .map(item => parseInt(item))
.slice(1,-1)

console.log([...new Set(input)].length)
//  [javascript]
function main(input) {
    const arr = input.trim().split('\n');
    const set = new Set(arr.slice(1))
    console.log(set.size)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
function Main(input) {
  input=input.split("\n");
  
  const N=input[0]-0;
  var ret=0;
  var array=[];
  for(var i=1;i<input.length;i++){
    if(!array.includes(input[i])){
      array.push(input[i]);
      ret++;
    }
  }
  console.log(ret);
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  console.log(new Set(input.slice(1)).size)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var (
	scanner = bufio.NewScanner(os.Stdin)
)

// nextLine は次の行を受け取り、文字列として返す関数
func nextLine() string {
	scanner.Scan()
	return scanner.Text()
}

// nextLineInt は次の行を受け取り、int型として返す関数
func nextLineInt() int {
	scanner.Scan()
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return num
}

func main() {
	// 1行を取得してint型に変換されたものをnに代入
	var lotteryNum int = nextLineInt()
	// string: int のマップをNの分だけ作成
	var lotteryKinds map[string]int = make(map[string]int, lotteryNum)

	for i := 1; i <= lotteryNum; i++ {
		var lotteryPrize string = nextLine()
		if _, state := lotteryKinds[lotteryPrize]; !state {
			lotteryKinds[lotteryPrize] = 1
		}
	}

	fmt.Println(len(lotteryKinds))
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	n := nextInt()
	var m = make(map[string]int, n)
	for _, str := range nextStrings(n) {
		m[str] = 1
	}

	count := 0
	for _, val := range m {
		count = count + val
	}

	fmt.Printf("%d\n", count)
}

func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func next() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	n := nextInt()
	s := make(map[string]int, n)

	for i := 1; i <= n; i++ {
		k := nextLine()
		if _, ok := s[k]; !ok {
			s[k] = 1
		} else {
			s[k] += 1
		}
	}

	fmt.Println(len(s))
}

// =================================
// I/O util
// =================================

var sc = bufio.NewScanner(os.Stdin)


func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

// =================================
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

/*-----------Main-----------*/

func main() {
	n := readI()
	s := readSs(n)

	fmt.Println(len(unique(s)))
}

func unique(a []string) []string {
	u := make([]string, 0, len(a))
	for _, v := range a {
		if !isContain(u, v) {
			u = append(u, v)
		}
	}
	return u
}

func isContain(a []string, b string) bool {
	for _, v := range a {
		if v == b {
			return true
		}
	}
	return false
}

/*-----------Utilities-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const maxBuf = 200100
	var buf []byte = make([]byte, maxBuf)
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBuf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error : There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readSs(a int) []string {
	b := make([]string, a)
	for i := 0; i < a; i++ {
		b[i] = readS()
	}
	return b
}

func readI() int {
	sc.Scan()
	r, _ := strconv.Atoi(sc.Text())
	return r
}

func readIs(a int) []int {
	b := make([]int, a)
	for i := 0; i < a; i++ {
		b[i] = readI()
	}
	return b
}

func readF() float64 {
	sc.Scan()
	r, _ := strconv.ParseFloat(sc.Text(), 64)
	return r
}

func readFs(a int) []float64 {
	b := make([]float64, a)
	for i := 0; i < a; i++ {
		b[i] = readF()
	}
	return b
}

func max(a []int) int {
	l := len(a)
	m := a[0]
	for i := 1; i < l; i++ {
		if a[i] > m {
			m = a[i]
		}
	}
	return m
}

func min(a []int) int {
	l := len(a)
	m := a[0]
	for i := 1; i < l; i++ {
		if a[i] < m {
			m = a[i]
		}
	}
	return m
}

func sortI(a []int) []int {
	sort.Ints(a)
	return a
}

func reverse(a []int) []int {
	l := len(a)
	r := make([]int, l)
	for i := 0; i < l; i++ {
		r[i] = a[l-i-1]
	}
	return r
}

func countI(a []int, b int) int {
	l := len(a)
	var c int
	for i := 0; i < l; i++ {
		if a[i] == b {
			c++
		}
	}
	return c
}
//  [go]
package main

import "fmt"

func main() {
	var a,b,c,d int
	fmt.Scan(&a, &b, &c, &d)
	if (a+d-1)/d >= (c+b-1)/b {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanInit()
	n := scanInt()
	lottery := map[string]bool{}
	count := 0
	for i:= 0; i<n; i++ {
		s := scan()
		if _,ok := lottery[s]; !ok {
			lottery[s] = true
			count ++
		}
	}
	fmt.Println(count)
}
var sc = bufio.NewScanner(os.Stdin)
func scanInit () {
	sc.Split(bufio.ScanWords)
}
func scanInt () int{
sc.Scan()
	i,_ := strconv.Atoi(sc.Text())
	return i
}
func scan () string{
	return sc.Text()
}
//  [ruby]
puts $<.read.split.drop(1).uniq.count
//  [ruby]
puts readlines.uniq.size - 1
//  [ruby]
n = gets.split.map(&:to_i)
array = readlines.map(&:chomp!)

puts array.uniq.size
//  [ruby]
n = gets.to_i
 
items = []
n.times do
  items.push gets.chomp
end
 
puts items.uniq
//  [ruby]
n = gets.to_i
 
items = []
n.times do
  items << gets
end
 
puts items.uniq
//  [ruby]
n = gets.to_i

items = []
n.times do
  items << gets
end

puts items.uniq
//  [rust]
use std::io::{stdin, Read};

fn main() {
    let mut buf = String::new();
    stdin().read_to_string(&mut buf).unwrap();
    let s: std::collections::HashSet<&str> = buf.split_whitespace().collect();
    println!("{}", s.len() - 1)
}
//  [rust]
use std::collections::HashSet;
use std::io::Read;

fn main() {
    let mut line = String::new();
    std::io::stdin().read_to_string(&mut line);
    let mut tok = line.split_whitespace();
    let mut n: usize = tok.next().unwrap().parse().unwrap();
    let mut r = HashSet::new();
    for _ in 0..n {
        r.insert(tok.next().unwrap());
    }
    println!("{}", r.len());
}
//  [rust]
use proconio::{input, fastout};
use std::collections::HashSet;

#[fastout]
fn main() {
    input! {
        n: usize,
        sss: [String; n],
    }

    let uniq: HashSet<&String> = sss.iter().collect();
    println!("{:?}", uniq.len());
}
//  [rust]
use proconio_derive::fastout;

#[fastout]
fn main() {
    proconio::input! {
        n: usize,
        mut s: [String;n]
    }
    let mut s: Vec<String> = s;
    s.sort();
    let mut ans = 0;
    let mut prv = String::new();
    for v in s {
        if prv != v {
            ans += 1;
        }
        prv = v;
    }
    println!("{}", ans);
}
//  [rust]
use std::io::*; //Not mine.
use std::str::FromStr;
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
use std::collections::HashSet;
fn main() {
    n: usize = read();
    s: HashSet<String> = HashSet::new();
    for i in 0..n {
        _s: String = read();
        s.insert(_s);
    }
    println!("{}", s.len());
}
//  [rust]
const NUM_OF_AB :usize = 26;
const A_INDEX   :usize = 97;

struct Category {
    //depth    :u32,
    children    :Vec<Category>,
    list        :Vec<String>,
    active_bmp  :u32,
}
impl Category {
    //fn new(depth :u32) -> Category
    fn new() -> Category
    {
        Category {
            //depth:    depth,
            children:   Vec::new(),
            list:       Vec::new(),
            active_bmp: 0,
        }
    }

    fn prepare(&mut self)
    {
        for _ in 0..NUM_OF_AB {
            self.children.push(Category::new());
        }
    }

    fn is_active(&self, key1 :usize, _key2 :usize) -> bool
    {
        let mut ret = false;
        if  (self.active_bmp & (1<<key1)) != 0  {
            //if  (self.children[key1].active_bmp & (1<<key2)) != 0  {
                ret = true;
            //}
        }
        ret
    }

    fn activate(&mut self, key1 :usize, _key2 :usize)
    {
        if  (self.active_bmp & (1<<key1)) == 0  {
            self.children[key1].prepare();
            self.active_bmp |= {1<<key1};
        }
        //println!("len = {}", self.children[key1].children[key2].list.len());
    }

    fn search(&self, word :&String) -> bool
    {
        let mut ret = false;
        for i in 0..self.list.len() {
            if  *word == self.list[i]  {
                ret = true;
                break;
            }
        }
        ret
    }

    fn push(&mut self, word :String)
    {
        self.list.push(word);
    }

    fn num_of_nodes(&self) -> u32
    {
        let mut total :u32 = 0;
        for frst in 0..NUM_OF_AB {
            for scnd in 0..NUM_OF_AB {
                if  self.is_active(frst, scnd)  {
                    total += {self.children[frst].children[scnd].list.len() as u32};
                }
            }
        }
        total
    }
}

fn index_get(c :char) -> usize
{
    (c as usize) - A_INDEX
}

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();

    let mut prize :Category = Category::new();
    prize.prepare();

    let num_of_prizes :usize = s.trim().parse::<usize>().ok().unwrap();

    for _ in 0..num_of_prizes {
        let mut s1 = String::new();
        std::io::stdin().read_line(&mut s1).ok();

        let mut si = s1.chars();
        let frst = index_get(si.next().unwrap());
        let scnd =
            match  si.next()  {
                None    => 0,
                Some(c) => index_get(c),
            };
        if  !prize.is_active(frst, scnd)  {
            prize.activate(frst, scnd);
        }
        if  !prize.children[frst].children[scnd].search(&s1)  {
            prize.children[frst].children[scnd].push(s1);
        }
    }

    println!("{}", prize.num_of_nodes());
}
//  [swift]
let N: Int = Int(readLine()!)!
var S: [String] = (1...N).map { _ in readLine()! }
print(Set(S).count)
//  [swift]
let N = Int(readLine()!)!
var S = Array(repeating: "", count: N)
for n in 0 ..< N {
    S[n] = readLine()!
}

print(Set(S).count)
//  [swift]
import Foundation

let a = Int(readLine()!)!
var k:[String] = []
for _ in 0 ..< a {
    let input_line: String = readLine()!
        k.append(input_line)
}
let orderedSet = NSOrderedSet(array: k)
let uniqueValues = orderedSet.array as! [String]
print(uniqueValues.count)
//  [swift]

import Foundation

let a = Int(readLine()!)!
var k:[String] = []
for _ in 0 ..< a {
    let input_line: String = readLine()!
        k.append(input_line)
}
let orderedSet = NSOrderedSet(array: k)
let uniqueValues = orderedSet.array as! [String]
print(uniqueValues)
//  [swift]
let a = Int(readLine()!)!
var k:[String] = []
for i in 0 ..< a {
    var input_line: String = readLine()!
        k.append(input_line)
}
let orderedSet = NSOrderedSet(array: k)
let uniqueValues = orderedSet.array as! [String]
print(uniqueValues)
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc001 {

    export class Program {

        constructor(private readonly args: string[]) {
        }

        /**
         * in
         *
         * out
         *
         */
        main(this: Program): void {
            const n: number = +this.args[0];
            const set = new Set();
            for (let i = 1; i <= n; i++) set.add(this.args[i]);
            console.log(set.size);
        }
    }
}

const args: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const prg: AtCoder.abc001.Program = new AtCoder.abc001.Program(args);
prg.main();
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const n = +input[0];
const a = new Set();
for (let i = 0; i < n; i++) {
	a.add(input[i + 1]);
}

console.log(a.size);
//  [typescript]
import { count } from 'console';

process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const n = Number(inputs[0]);
  let hitList = new Set;

  for (let i = 1; i <= n; i++) {
    hitList.add(inputs[i]);
  }

  console.log(hitList.size);
}
//  [typescript]
import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').split('\n') // ['1', '2' , ...]
const output = (x: any) => console.log(x)
// debug(input)
const [N, ...S] = input
// debug(N)
// debug(S)

const set = new Set<string>()

S.map(s => {
    set.add(s)
})

output(set.size)
//  [typescript]
import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').split('\n') // ['1', '2' , ...]
const output = (x: any) => console.log(x)
// debug(input)
const [N, ...S] = input
// debug(N)
// debug(S)

const map = new Map<string, number>()

S.map(s => {
    const v = map.get(s)
    if (v !== undefined) {
        map.set(s, v + 1)
    } else {
        map.set(s, 0)
    }
})

// debug(map)
output(map.size)
//  [typescript]
function Main(input) {
    const [N, ...S] = input.split("\n")
    S.sort()
    const s = S.reduce((pre, cur, index) => {
        return !pre[index-1] ? [cur] : pre[index-1] === cur ? pre : [...pre, cur]
    },[])
    console.log(s.length)
    // console.log(new Set(S).size)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [python]
P,Q,R = list(map(int,input().split()))
ABC=P+Q
ACB=R+Q
BAC=P+R
BCA=Q+R
CAB=R+P
CBA=Q+P
print(min([ABC,ACB,BAC,BCA,CAB,CBA]))
//  [python]
P, Q, R = map(int, input().split())
print(min(P+Q, Q+R, R+P))
//  [python]
# -*- coding: utf-8 -*-
P,Q,R = [int(i) for i in input().split()]
if P+Q <= Q+R and P+Q <= P+R:
    print(P+Q)
elif Q+R <= P+Q and Q+R <= P+R:
    print(Q+R)
elif P+R <= Q+R and P+R <= P+Q:
    print(P+R)
//  [python]
p, q, r = map(int, input().split())

print(sum[p, q, r] - max[p, q, r])
//  [python]
P, Q, R = map(int, input().split())

list_m = [P+Q,R+Q,P+R,Q+R,R+P,Q+P]

min = 100
for i in range(0,len(list_m)):
    if min > int(list_m[i]):
        min = list_m[i]

print(min)
//  [python]
P, Q, R = map(int, input().split())

list_m = [P + Q,R + Q,P + R,Q + R,R + P,Q + P]

min = 100
for i in range(len(list_m)):
    if min > int(list_m[i]):
        min = list_m[i]

print(min)
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int p = Integer.parseInt(str[0]);
    int q = Integer.parseInt(str[1]);
    int r = Integer.parseInt(str[2]);
    
    int ans = 0;
    System.out.println(Math.min(p+q,Math.min(q+r,p+r)));
  }
}
//  [java]
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int[] line = new int[3];

		for (int i = 0; i < 3; i++) {
			line[i] = sc.nextInt();
		}

		int min = Integer.MAX_VALUE;

		for (int i = 0; i < args.length; i++) {
			for (int j = 0; j < args.length; j++) {
				if (i ==j) {
					continue;
				}
				min = Math.min(min, line[i] + line[j]);
			}
		}

		System.out.println(min);
	}

}
//  [java]
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int[] line = new int[3];

		for (int i = 0; i < 3; i++) {
			line[i] = sc.nextInt();
		}

		int min = Integer.MAX_VALUE;

		for (int i = 0; i < args.length; i++) {
			for (int j = 0; j < args.length; j++) {
				if (i ==j) {
					continue;
				}
				min = Math.min(min, line[i] + line[j])
			}
		}

		System.out.println(min);
	}

}
//  [cpp]
#include<stdio.h>
int main()
{
    int p,q,r;
    scanf("%d%d%d",&p,&q,&r);
    int a,b,c;
    a=p+q;b=p+r;c=q+r;
    if(a>b)
        a=b;
    if(a>c)
        a=c;
    printf("%d\n",a);
}
//  [cpp]
#include<stdio.h>
int main()
{
    int a,b,c,mmin;
    scanf("%d%d%d",&a,&b,&c);
    mmin=(a+b)<(a+c)?(a+b):(a+c);
    mmin=mmin<(b+c)?mmin:(b+c);
    printf("%d\n",mmin);
    return 0;
}
//  [cpp]
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int a[20];
int b[20];
int ans=0;
int vis[25];
void dfs(int sum,int deep)
{
    if(deep==2)
    {
                b[++ans]=sum;
                return;

    }
    for(int i=1;i<=3;i++)
    {
        if(vis[i]==0)
        {
            vis[i]=1;
        dfs(sum+a[i],deep+1);
        vis[i]=0;
        }

    }
}
int main()
{
    ans=0;
    memset(vis,0,sizeof(vis));
    for(int i=1;i<=3;i++)
        scanf("%d",&a[i]);
        dfs(0,0);
    sort(b+1,b+1+ans);
        printf("%d\n",b[1]);
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;


long long dp[100010];
long long nota[100010];


long long rec(int i){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(i-1)+1+rec(i-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
int n,m;

  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;


long long dp[100010];
long long nota[100010];


long long rec(int i){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){
int n,m;

  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int n,m;
long long dp[100010];
long long nota[100010];


long long rec(int i){
if(i==0)return 0;  
long long x=1000000007;
if(dp[i]!=-1){  
if(i==1)return dp[i]=1;
if(i>1){
dp[i]=(rec(n-1)+1+rec(n-2)+1+x)%x;
}
  return dp[i];
}
else return dp[i];  
  
}
int main(){


  cin >> n >> m;
for(int i=0;i<100010;i++){
cin >> nota[i];
dp[i]=0;  
}
for(int i=0;i<m;i++){
dp[nota[i]]=-1;
}
  
cout << rec(n) << endl;  
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll a,b,c;
int main(){
	scanf("%lld%lld%lld",&a,&b,&c);
    printf("%lld",a+b+c-max(a,max(b,c)));
}
//  [c]
#include <stdio.h>

#define max(a,b) (((a)>(b))?(a):(b))
int main(void)
{
	int p, q, r;
	scanf("%d %d %d", &p, &q, &r);
	printf("%d\n",p+q+r-max(max(p,q),max(q,r)));
	return(0);
}
//  [c]
#include<stdio.h>
int main(void){
    int a,b,c;
    int ab,bc,ca;
    scanf("%d %d %d",&a,&b,&c);
    ab=a+b;
    bc=b+c;
    ca=c+a;
    if(ab<bc&&ab<ca){
        printf("%d\n",ab);
    }else if(bc<ca){
        printf("%d\n",bc);
    }else{
        printf("%d\n",ca);
    }
    return 0;
}
//  [c]
#include <stdio.h>
int main(){
  int N,W[200],M=1000000;
  scanf("%d",&N);
  W[0]=0;
  for(int i=1;i<=N;i++){
    scanf("%d",W+i);
    W[i]+=W[i-1]; 
  }
  int S;
  for(int i=1;i<N;i++){
    S=W[N]-2*W[i];
    if(S<0) S=-S;
    if(S<M) M=S;
  }
  printf("%d\n",M);
  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(a>=b&&a>=c){
	printf("%d",b+c);
    } else if {(b>=a&&b>=c)
	printf("%d",a+c);
    } else {
	printf("%d",a+b);
    }
	return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	int a,b,c,x=0,y=0,z=0;
	scanf("%d %d %d",&a,&b,&c);
	x=a+b;
	y=a+c;
	z=b+c;
	if(x<=y&&x<=z) printf("%d\n",x);
	if(y<x&&y<=z) printf("%d\n",x);
	if(z<x&&z<y) printf("%d\n",z);
	return 0;
}
//  [javascript]
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var P = one[0];
  var Q = one[1];
  var R = one[2];
  var output = [P + Q,Q + R, R + P];
  myout(Math.min.apply(null,output));
}
//  [javascript]
function Main(input){
var P = input.split(" ")[0];
var Q = input.split(" ")[1];
var R = input.split(" ")[2];
var A = new Number(P)+new Number(Q);
var B = new Number(Q)+new Number(R);
var C = new Number(R)+new Number(P);
if(A>=B&&C>=B){
  console.log(B);
}else if(B>=A&&C>=A){
  console.log(A);
}else if(B>=C&&A>=C){
  console.log(C);
}
}
  Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input) {
  tmp = input.split(" ").sort();
  console.log(Number(tmp[0])+ Number(tmp[1]));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(intput){
    const args=input.split(' ');
    const p=parseInt(args[0],10);
    const q=parseInt(args[1],10);
    const r=parseInt(args[2],10);
    const array=[p+q,p+r,r+q];
    console.log(Math.min.apply(null,array));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input){
  const args=input.split(' ');
  const P=parseInt(args[0], 10);
  const Q=parseInt(args[1], 10);
  const R=parseInt(args[2], 10);
  const arrr=[P+Q, P+R, Q+R];
  console.log(arrr);
  console.log(Math.min.apply(null, arrr));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line)
});

reader.on('close', () => {

  lines = lines[0].split(' ')

  var min = Math.min(...lines)
  lines = lines.filter(x => x != min)
  var minSecond = Math.min(...lines)
  
  console.log(min + minSecond)

});
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)

func main() {
	list := getStdinIntArr()

	min := math.MaxInt32
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			if i == j {
				continue
			}
			if list[i]+list[j] < min {
				min = list[i] + list[j]
			}
		}
	}

	fmt.Printf("%d\n", min)
}

func getStdin() string {
	return readLine()
}
func getStdinArr() []string {
	str := getStdin()
	list := strings.Split(str, " ")
	return list
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}

func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}

func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, e := sc.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}