Cost of Retained Earnings - flotation costs?

Is it simply calculated as Dividends / Market Price of Stock (begining or end of period?) and does it take flotation costs into account. Im confused about this subject, just a basic formula would help. I don't know if it's the same as the PE formulas.