Roth IRA Withdrawal for First time Home Buyers how much can I withdraw exactly?

I was looking to withdraw the max amount I can out of my Roth IRA for a first time home purchase.

 

My contributions so far

 

2013- $5,500

2014- $5,500

2015- $5,500

2016- $5,500

2017- $5,500

2018- $5,500

This year

2019- $6,000

 

I assume I can withdraw $39,000 from my contributions, including this years 2019 contribution.

 

According to my Roth IRA atm 

$11,067.27 Total assets

Investment returns +$10,330.22
 
So far this is how much I sold to withdraw
$34,200.00 
$3,870.55 
Total : $38,070.55
 
So according to this I can withdraw another $929.45 from my contributions which would make my total assets down to $11,067.27-$929.45 = $10,137.82
 
I guess on Monday I should sell all my funds let it sit in the Roth IRA and do these calculations again.
 
Do I need to tell my Roth IRA company that I'm doing this? In case i want to put back this years contributions? I read some where since I contributed this year 6k whatever earnings I gained from the 6k needs to be reverse?