#include <stdio.h>

void main()
{
	int friends;
	int oranges;
	FILE *input = fopen("orange.in","rb");
	FILE *output = fopen("orange.out","wb");

	fscanf(input, "%i",&friends);
	fscanf(input, "%i",&oranges);
	
	int a = friends, b = oranges;
	while (a > 0) {
	    int t = b % a;
	    b = a;
	    a = t;
	}
	
	fprintf(output, "%i", friends / b);
	
	fclose(input);
	fclose(output);
}