const isPrimary=(number)=>{
let count=0;
for (let i=1;i<=number;i++){
if (number%i===0){
count+=1;
}
}
if (count===2){
return true;
}else{
return false;
}
}
function solution(n,k){
let answer=0;
let convert=n.toString(k);
let splitConvert=convert.split(0);
splitConvert=splitConvert.filter((el)=>+el!==0).map((el2)=>+el2);
for (let i=0;i<splitConvert.length;i++){
if (isPrimary(splitConvert[i])){
answer+=1;
}
}
return answer;