Calculate Greatest Common Factor