import java.util.; public class Main{ public static void main(String[] args){ Scanner in=new Scanner(System.in); int A=in.nextInt(); int B=in.nextInt(); int T; int origA=A; int origB=B; while(B!=0) { T=A%B; A=B; B=T; } System.out.println(origAorigB/A); } }