package Deom1;
import java.awt.*;
import java.util.Scanner;
public class lx {
//输入任意两个正整数,求出这两个正整数之间素数的个数
public static void main(String [] args) {
Scanner input=new Scanner(System.in);
int x=input.nextInt();
int y=input.nextInt();
int a;
int num=0,add=0;
if(x==y) {
System.out.print("两数相等请重新输入");
}
if(y<x) {
a=y;
y=x;
x=a;
}
for(int i=x;i<=y;i++){
int k = (int)Math.ceil(i/2);
boolean flag = true;
for(int j=2;j<=k;j++) {
if(i%j==0) {
flag = false;
}
}
if(flag){
num++;
add+=i;
}
}
System.out.println(num);
}
}