import java.util.*;
public class Main
{
public static void main
(String[] args
) {
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
int k = in.nextInt();
int[] elem_tree = new int[n];
int ans=0, left=0, right=0;
for(int i=0; i<n; i++){
elem_tree[i]=in.nextInt();
if (elem_tree[i]==k){
ans+=i-left+1;
right=i;
}
else{
if(elem_tree[i]>k){
right=0;
left=i+1;
}
else if(elem_tree[i]<k && right!=0) ans+=right-left+1;
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwoKCnB1YmxpYyBjbGFzcyBNYWluCnsKICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSAKICB7CiAgICBTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgIGludCBuID0gaW4ubmV4dEludCgpOwogICAgaW50IGsgPSBpbi5uZXh0SW50KCk7CiAgICBpbnRbXSBlbGVtX3RyZWUgPSBuZXcgaW50W25dOwogICAgaW50IGFucz0wLCBsZWZ0PTAsIHJpZ2h0PTA7CiAgICBmb3IoaW50IGk9MDsgaTxuOyBpKyspewogICAgCWVsZW1fdHJlZVtpXT1pbi5uZXh0SW50KCk7CiAgICAJaWYgKGVsZW1fdHJlZVtpXT09ayl7CiAgICAJCWFucys9aS1sZWZ0KzE7CiAgICAJCXJpZ2h0PWk7CiAgICAJfQogICAgCWVsc2V7CiAgICAJCWlmKGVsZW1fdHJlZVtpXT5rKXsKICAgICAgICAJCQlyaWdodD0wOwogICAgICAgIAkJCWxlZnQ9aSsxOwogICAgCQl9CiAgICAJCWVsc2UgaWYoZWxlbV90cmVlW2ldPGsgJiYgcmlnaHQhPTApIGFucys9cmlnaHQtbGVmdCsxOwogICAgCX0KICAgIH0KICAgIFN5c3RlbS5vdXQucHJpbnRsbihhbnMpOwogIH0KfQ==