#include int main(){ int N,A,B; scanf("%d %d %d",&N,&A,&B); int ans=0; for(int i=1;i<=N;i++){ if(i%A>i%B){ ans++; } } printf("%d\n",ans); return 0; }