Ishaan has N dollars in his bank account. He wants to withdraw all of it. But the bank has a policy that the amount withdrawn must be a divisor of the current amount **(except the amount itself)**.

Ishaan wants his money as soon as possible, so he withdraws the maximum amount from his bank each day. Determine the number of days he will need to withdraw all of his money.

**Note :** If the remaining amount is 1, he can withdraw it.

**Input : **

First line of input contains a single integer T denoting the number of test cases.

The only line of each test case contains an integer N.

**Output : **

For each test case, print the required answer in a new line.

**Constraints : **

1 <= T <= 200

1 <= N <= 10^12

**Example :
Input : **

3

12

21

9

5

7

5

**Explanation :
Case 1 : **

N = 12

Remaining = 6

Remaining = 3

Remaining = 2

Remaining = 1

Remaining = 0

**Case 2 : **

N = 21

**Withdraws 7**

Remaining = 14

**Withdraws 7**

Remaining = 7

**Withdraws 1**

Remaining = 6

**Withdraws 3**

Remaining = 3

**Withdraws 1**

Remaining = 2

**Withdraws 1**

Remaining = 1

**Withdraws 1**

Remaining = 0

**Case 3 : **

N = 9

**Withdraws 3**

Remaining = 6

**Withdraws 3**

Remaining = 3

**Withdraws 1**

Remaining = 2

**Withdraws 1**

Remaining = 1

**Withdraws 1**

Remaining = 0

Author: goyalanubhav11

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

d_Coder00 | 134 |

Astikeysingh | 128 |

dungeon_master1299 | 126 |

rajendrashekhawat063 | 115 |

VivSisMMM | 112 |

Pulkit__Sharma__ | 646 |

Anirban166 | 531 |

abducodes | 508 |

Found_me | 474 |

Sathvik Avasarala | 418 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4559 |

Login to report an issue on this page.